资源预览内容
第1页 / 共2页
第2页 / 共2页
亲,该文档总共2页全部预览完了,如果喜欢就下载吧!
资源描述
#include #include typedef struct node int data;struct node *next; NODE; NODE *create() NODE *head,*q,*p;int a,n;head=(NODE*)malloc(sizeof(NODE);q=head;printf(“nInput number of the list: “);scanf(“%d“,if(n0)printf(“Input the list: “);while(n0)scanf(“%d“,p=(NODE*)malloc(sizeof(NODE);p-data=a;q-next=p;q=p;n-;q-next=NULL;return(head); void print(NODE *head) NODE *p;p=head-next;printf(“Output the list: “);while(p!=NULL)printf(“%3d“,p-data);p=p-next; main() NODE *a; a=create(); print(a); printf(“n“);
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号