标签:lse class 不能 sizeof include std NPU ack can
10 11 3 5 27 9 12 43 16 84 22
22 84 16 43 12 9 27 5 3 11
1 #include<stdio.h> 2 #include<stdlib.h> 3 struct node 4 { 5 int data ; 6 struct node*next; 7 }; 8 int main() 9 { 10 int n,i; 11 struct node *head,*p; 12 head =(struct node*)malloc(sizeof(struct node)); 13 head->next=NULL; 14 scanf("%d",&n); 15 for(i=0;i<n;i++) 16 { 17 p=(struct node*)malloc(sizeof (struct node)); 18 scanf("%d",&p->data); 19 p->next =head->next; 20 head->next=p; 21 } 22 for(p=head->next ;p!=NULL;p=p->next) 23 { 24 if(p==NULL) 25 printf("%d\n",p->data); 26 else printf("%d ",p->data); 27 } 28 return 0; 29 }
标签:lse class 不能 sizeof include std NPU ack can
原文地址:https://www.cnblogs.com/xiaolitongxueyaoshangjin/p/12063579.html