C语言高手帮我填空#include <stdio.h>#include
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/11 22:49:05
C语言高手帮我填空
#include <stdio.h>
#include <stdlib.h>
#define N 8
typedef struct list
{ int data;
struct list *next;
} SLIST;
SLIST *creatlist(int *);
void outlist(SLIST *);
int fun( SLIST *h)
{
SLIST *p; int
s=0;
p=h->next;
while(p)
{
//
printf("\nsum=%d\n", fun(___3___));
}
SLIST *creatlist(int a[])
{
SLIST *h,*p,*q; int
i;
h=p=(SLIST *)malloc(sizeof(SLIST));
for(i=0; i<N; i++)
{ q=(SLIST
*)malloc(sizeof(SLIST));
q->data=a[i];
p->next=q; p=q;
}
p->next=0;
return h;
}
void outlist(SLIST *h)
{ SLIST *p;
p=h->next;
if
(p==NULL) printf("The list is
NULL!\n");
else
{ printf("\nHead ");
do
{ printf("->%d",
p->data); p=p->next; }
while(p!=NULL);
printf("->End\n");
}
}
#include <stdio.h>
#include <stdlib.h>
#define N 8
typedef struct list
{ int data;
struct list *next;
} SLIST;
SLIST *creatlist(int *);
void outlist(SLIST *);
int fun( SLIST *h)
{
SLIST *p; int
s=0;
p=h->next;
while(p)
{
//
printf("\nsum=%d\n", fun(___3___));
}
SLIST *creatlist(int a[])
{
SLIST *h,*p,*q; int
i;
h=p=(SLIST *)malloc(sizeof(SLIST));
for(i=0; i<N; i++)
{ q=(SLIST
*)malloc(sizeof(SLIST));
q->data=a[i];
p->next=q; p=q;
}
p->next=0;
return h;
}
void outlist(SLIST *h)
{ SLIST *p;
p=h->next;
if
(p==NULL) printf("The list is
NULL!\n");
else
{ printf("\nHead ");
do
{ printf("->%d",
p->data); p=p->next; }
while(p!=NULL);
printf("->End\n");
}
}
1 . data
2. next
3. head
运行结果:
2. next
3. head
运行结果:
C语言高手帮我填空#include <stdio.h>#include
c语言编程计算数列合#include <stdio.h> #include &
#include <stdio.h>
转置矩阵#include <stdio.h> #include <stdlib.h>
C语言求余数问题#include<stdio.h>main(){ int x,y,a,b,c;&n
一道c语言题,#include<stdio.h>#include<string.h>#inclu
求M和N最大公约数?#include<stdio.h>void main(){ &nbs
下面是我的答案#include<stdio.h>int main(){ char a[100],b
C语言函数求面积#include "stdio.h"#define p 
while语句!#include <stdio.h>#include <windows.h>in
运行后的图是:#include <stdio.h>#include <stdlib.h>void
C语言编程数位的调换#include<stdio.h>int main(void){\x05int n,m,