#include <stdio.h> #include <stdlib.h> struct node { int date; struct node *next; }*head=NULL,*q=NULL,*t=NULL,*bl=NULL,*p=NULL; //head头 q尾 t中间 bl中间 int main() { int i,n; scanf("%d",&n); for(i=0;i<n;i++) { p=(struct node *)malloc(sizeof(struct node)); if(head==NULL) { head=p; } else { t->next=p; p->next=NULL; } scanf("%d",&p->date); t=p; } p=head; while(p!=NULL) { printf("%d",p->date); if(p->next!=NULL) { printf(" "); } else { printf("\n"); } p=p->next; } return 0; }