void fun (SLIST *h,int x)
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/17 19:49:52
void fun (SLIST *h,int x)
{ SLIST *p,*q,*s;
s=(SLIST*) malloc (sizeof (SLIST));
s->data=x;
q=h;
p=h->next;
while(p!=NULL && x>p->data) {
q=p;
p=p->next;
}
s->next=p;
q->next=s;
}
{ SLIST *p,*q,*s;
s=(SLIST*) malloc (sizeof (SLIST));
s->data=x;
q=h;
p=h->next;
while(p!=NULL && x>p->data) {
q=p;
p=p->next;
}
s->next=p;
q->next=s;
}
![void fun (SLIST *h,int x)](/uploads/image/z/7780437-45-7.jpg?t=void+fun+%28SLIST+%2Ah%2Cint+x%29)
SLIST应该是个含有int data,SLIST * next的结构体这段代码就是分配一个SLIST类型的结构体,并将其插入原列表(原列表按data字段升序排序号得,插入之后顺序保持不变),C指针太难搞了
void fun (SLIST *h,int x)
void fun(int *x,int y)
#include void fun (int,int); void main (void) { int i,j,x,y,
void main() {int t=1;fun(fun(t));} fun(int h) {st
#include void fun(int x) { x=20; } main() { int x=10; fun(x)
#include void fun(int x) { if(x/2>0)fun(x/2); printf("%d",x)
递归函数计算x^n#include double fun(int n,double x);int main(void){
#include "stdio.h" void fun(int a,int b) { int t; t=a,a=b,b=
#include #include // void fun(int a,int b,int c
求此题解题过程:#include #define N 8 void fun(int *x,int i) {*x=*(x+
void fun (char *a,char *h,char *p) { int j=0; char *q=a; whi
void sort(int x[],int n)