semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct st
{
     char id[20];
     char name[20];
     char sex;
     int age;
     float goal;
     char address[20];
     struct st *last;
};

struct st *input(void)
{
       int n;
       struct st *end,*p1,*p2;
       n=0;
       p1=p2=(struct st *)malloc(sizeof(struct st));
       scanf("%s",p1->id);
       while(strcmp(p1->id,"end")!=0)
       {
            scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->goal,p1->address);
            if(n==0) p1->last=NULL;
            else p1->last=p2;
            p2=p1;
            p1=(struct st *)malloc(sizeof(struct st));
            scanf("%s",p1->id);
            n=1;
       }
       end=p2;
       return(end);
}

void output(struct st *end)
{
     struct st *p;
     p=end;
     if(end!=NULL)
        do
        {
              printf("%s %s %c %d ",p->id,p->name,p->sex,p->age);
              if(floor(p->goal)==p->goal) printf("%.0f",p->goal);
              else printf("%.1f",p->goal);
              printf(" %s\n",p->address);
              p=p->last;
        }while(p!=NULL);
}

int main()
{
     struct st *end;
     end=input();
     output(end);
}
struct stu
	{
		char xh[10];
		char name[20];
		char xb;
		int age;
		char score[20];
		char add[20];
		struct stu *next;
	};
    struct stu *creat()
	{
	struct stu *head,*p1,*p2;
	int n=0;
    p1=p2=(struct stu *)malloc(sizeof (struct stu));
	head=0;
	while(strcmp(p1->xh,"end")!=0)
	{
		n++;
		if(n==1)
		{
			p1->next=0;
			head=p1;
		}
		else
		{
	    	p2=p1;
	    	p1=(struct stu *)malloc(sizeof (struct stu));
	    	p1->next=p2;
		}
		scanf("%s",&p1->xh);
		if(strcmp(p1->xh,"end")==0)
		{
			head=p2;
			break;
		}
		scanf(" %s %c %d %s %s",&p1->name,&p1->xb,&p1->age,&p1->score,&p1->add);
	}
	return (head);
	}
void print(struct stu *head)
{
	struct stu *p;
	p=head;
	while (p!=0)
	{
		printf("%s %s %c %d %s %s\n",p->xh,p->name,p->xb,p->age,p->score,p->add);
		p=p->next;
	}
}
    void main()
	{
		struct stu *head;
		head=creat();
		print(head);
	}
struct student
{char a[88];
struct student *next;
};
struct student *creat(void)
{struct student *p1,*p2,*head;
p1=p2=(struct student *)malloc(LEN);
gets(p1->a);
p1->next=0;
while(strcmp(p1->a,"end")!=0)
{p2=p1;
p1=(struct student *)malloc(LEN);
gets(p1->a);
p1->next=p2;

}
head=p2;
return(head);
}
void print(struct student *head)
{struct student *p;
p=head;
while(p!=0)
{puts(p->a);
p=p->next;}
}
void main()
{struct student *head;
head=creat();
print(head);
}
struct student
{
	char num[10];
	char name[20];
	char sex;
	int age;
	char score[10];
	char id[20];
	struct student *pre;
};
void main()
{
	struct student *p1,*p2,*end;
	p1=(struct student *)malloc(sizeof(struct student));
	end=p1;
	p2=p1;
	p1->pre=NULL;
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->id);
	for(;1;)
	{
		p1=(struct student *)malloc(sizeof(struct student));
		scanf("%s",p1->num);
		if(strcmp(p1->num,"end")==0){end=p2;break;}
		else scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->id);
		p1->pre=p2;
		p2=p1;
	}
	p1=end;
	for(;p1!=NULL;)
	{
	   printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->id);
	   p1=p1->pre;
	}
}
struct student
{
	struct student *next;
	char num[20];
	char name[20];
	char sex[2];
	int age;
	float score;
	char address[40];
};
struct student *creat()
{
	struct student *head,*p1,*p2;
	p1=(struct student *)malloc(LEN);
	scanf("%s",p1->num);
	if(strcmp(p1->num,"end")!=0)
	{
		scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->address);
		p2=p1;
		p2->next=NUL;
		p1=(struct student *)malloc(LEN);
		scanf("%s",p1->num);
		while(strcmp(p1->num,"end")!=0)
		{
			scanf("%s%s",p1->name,p1->sex);
			scanf("%d%f%s",&p1->age,&p1->score,p1->address);
			p1->next=p2;
			p2=p1;
			p1=(struct student *)malloc(LEN);
			scanf("%s",p1->num);
		}
		head=p2;
	}
	else
		head=NUL;
	return(head);
}
void print(struct student *head)
{
struct student *p;
p=head;
while(p!=NUL)
{
printf("%s %s %s %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
p=p->next;
}
}
int main()
{
struct student *head;
head=creat();
print(head);
return 0;
}
struct student //??????
{
	char num[10]; //??
	char name[20]; //??
	char sex[5]; //??
	int age; //??
	char score[20]; //??
	char addr[20]; //??
	struct student *next;
};
struct student *head; //???????
struct student *input() //??????
{
	struct student *p1,*p2;
		p1=p2=(struct student *)malloc(sizeof(struct student)); //????????????
		scanf("%s",p1->num); //????
		p2->next=NULL; //??p2????
		while(strcmp(p1->num,"end")!=0) //???????end??????????
		{
			scanf("%s",p1->name); //????
			scanf("%s",p1->sex); //????
			scanf("%d",&p1->age); //????
			scanf("%s",p1->score); //????
			scanf("%s",p1->addr); //????
			p1=(struct student *)malloc(sizeof(struct student)); //??????????
			scanf("%s",p1->num); //????
			p1->next=p2; //p2????p1????????
			p2=p1; //?p1?????p2
		}
		head=p1; //?????p1
		return(head); //??
}
void print(struct student *head) //??????
{
	struct student *p; //??????????????
	p=head->next; //p?????????????
	if(head!=NULL) //????????????
		do
		{
			printf("%s %s %s %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->addr);
			p=p->next;
		}
		while(p!=NULL); //?p?????????????????????
}
main() //?????
{
	input(); //??????
	print(head); //??????
	struct student *p1,*p2; //????????
	p1=p2=head->next; //?p1?p2??????????
	if(head!=NULL) //???????NULL???
		do
		{
			p1=p2->next; //?p2?????????p1
			free(p2); //??p2???
			p2=p1;	 //?p1????p2
		}
		while(p2!=NULL); //?p2??NULL???
	return 0; //??;
}
struct stu
	{
		char num[100];
		char name[100];
		char sex[10];
		int age;
		char score[100];
		char add[100];
		struct stu *before;
	};
void main()
{
	struct stu *p2;
	struct stu * f();
	p2=f();
	while (p2!=0)
	{
		printf("%s %s %s %d %s %s\n",p2->num,p2->name,p2->sex,p2->age,p2->score,p2->add);
		p2=p2->before;
	}
}

struct stu * f()
{
	struct stu *p1,*p2;
	p1=(struct stu *)malloc(sizeof (struct stu));
	p2=p1;
	scanf("%s",p1->num);
	p1->before=0;
	if (strcmp(p1->num,"end")!=0)
	{
	do 
	{
		p2=p1;
		scanf("%s%s%d%s%s",p1->name,p1->sex,&p1->age,p1->score,p1->add);
		p1=(struct stu *)malloc(sizeof (struct stu));
		p1->before=p2;
		scanf("%s",p1->num);
	}
	while (strcmp(p1->num,"end")!=0);
	}
	return p2;
}
struct student
{
	char str[1000];
	struct student *next;
};

struct student *create(void)
{
	struct student *head;
	struct student *p1,*p,*p2;
	head=p1=(struct student *)malloc(len);
 	gets(p1->str);
	p1->next=0;
	p2=p1;
	while(strcmp(p1->str,"end")!=0)
	{
		p=head;
		head=p1;
		head->next=p;
		p1=(struct student *)malloc(len);
		gets(p1->str);
	}
	p2->next=0;
	return(head);
}

void print(struct student *head)
{
	struct student *p1;
	p1=head;
	if(head!=0)
		do
		{
			puts(p1->str);
			p1=p1->next;
		}while(p1!=0);
}

void main()
{
	struct student *head;
	head=create();
	print(head);
}
struct shuju
{
    char xh[20];
    char xm[20];
    char sex;
    int age;
   char fen[10];
    char dorm[20];
    struct shuju * next;
};

struct shuju *create()
{
    
    struct shuju *head,*p1,*p2;
    p1=(struct shuju* )malloc(len);
    scanf("%s %s %c %d %s %s",p1->xh,p1->xm,&p1->sex,&p1->age,p1->fen,p1->dorm);
    p1->next=NULL;
    while (1)
    { 

    	p2=p1;
        p1=(struct shuju* )malloc(len); 
        scanf("%s",p1->xh);
        if (strcmp(p1->xh,"end")==0) {free(p1);break;}
        else
        {scanf("%s %c %d %s %s",p1->xm,&p1->sex,&p1->age,p1->fen,p1->dorm);
        p1->next=p2;}
    }
    head=p2;
    return (head);
}

void print(struct shuju* head)
{

    struct shuju* p;
    p=head;
    while (p->next!=NULL)
    {
        printf("%s %s %c %d %s %s\n",p->xh,p->xm,p->sex,p->age,p->fen,p->dorm);
       p=p->next;}
     printf("%s %s %c %d %s %s\n",p->xh,p->xm,p->sex,p->age,p->fen,p->dorm);
}

void main()
{
    
    
    struct shuju *p;
    p=create();
    print(p);
}
struct student
{
       char num[100];
       struct student *pNext;
};
int main()
{
    int i,count=0;
    struct student a[1000],*pheader,*p;
    for(i=0;;i++)
    {
       gets(a[i].num);
       count++;
       if(strcmp(a[i].num,"end")==0)
          break;
    }
    pheader=&a[count-2];
    for(i=count-2;i>=1;i--)
    {
       a[i].pNext=&a[i-1];                  
    }
    a[0].pNext=NULL;
    p=pheader;
    while(p!=NULL)
    {
        puts(p->num);
        p=p->pNext;
    }
}
struct student
 {
        char all[100];
        
        struct student *next;
        };
        
 main()
 {
       int k;
       int a=0;
       struct student *p;
       struct student *head;
       struct student *p1,*p2;
       p1=p2=(struct student *)malloc(n);
       head=NULL;
       k=0;
       for(k=0;;k++)
       {
       gets(p1->all);
       a++;
       if((p1->all)[0]!='e')
               {
                             if(a==1)
                              p1->next=NULL;
                                   else
                                   p1->next=p2;
                                   p2=p1;
                                   p1=(struct student *)malloc(n);
                             }
                             
                            else 
                             {
                                 head=p2;
                                 break;
                                 }
                                 }
                                 p=head;
                                 while(p!=NULL)
                                 {
                                               puts(p->all);
                                               p=p->next;
                                               }
                                      
                                       }
struct st
{
	char id[10000];
	struct st *next;
};

int main()
{
	struct st *head=NULL,*p=NULL,*q=NULL;
	char end;
	while (1)
	{
		p=(struct st*)malloc(sizeof(struct st));
		if(p!=NULL)
		{
			gets(p->id);
			p->next=q;
			if (p->id[0]=='e')
				break;
			else
			q=p;

		}
	}

	p=p->next;
	while(1)
	{
		puts(p->id);
		if (p->next==NULL)
			break;
		p=p->next;


	}

}
main()
{
      struct INF {char a1[20];char a2[20];
      char a3[20];char a4[20];char a5[20];
      char a6[20];struct INF *pp;} *p1,*p2;
      p1=(struct INF *)malloc(sizeof(struct INF));
      p2=NULL;
      int n=0,i;
      scanf("%s",p1->a1);
      while (strcmp(p1->a1,"end")!=0)
      {  scanf("%s",p1->a2);
         scanf("%s",p1->a3);
         scanf("%s",p1->a4);
         scanf("%s",p1->a5);
         scanf("%s",p1->a6);
         p1->pp=p2;
         p2=p1;
         p1=(struct INF *)malloc(sizeof(struct INF));
         scanf("%s",p1->a1);
         n++;     }
      for (i=0;i<n;i++)
      {printf("%s %s %s %s %s %s\n",p2->a1,p2->a2,p2->a3,p2->a4,p2->a5,p2->a6);
       p2=p2->pp;}      
      }
struct student
{
	char num[100];
	char name[30];
	char sex;
	int age;
	float grade;
	char adress[30];
	struct student *next;
	struct student *before;
};
int n;
struct student *creat(void)
{
	struct student *head,*end;
	struct student *p1,*p2;
	char str[5]={"end"};
	n=0;
	p1=p2=( struct student *)malloc(LEN);
	scanf("%s %s %c %d %g %s",&p1->num,p1->name,&p1->sex,&p1->age,&p1->grade,p1->adress);
	head=NULL;
	do
	{
		n=n+1;
		if(n==1)  {head=p1;p1->before=NULL;}
		else
		{
			p2->next=p1;
			p1->before=p2;
		}
		p2=p1;
		p1=( struct student *)malloc(LEN);
		scanf("%s",&p1->num);
		if(strcmp(p1->num,str)==0)
			break;
		scanf("%s %c %d %g %s",p1->name,&p1->sex,&p1->age,&p1->grade,p1->adress);
	}while(n<1000);
	end=p2;
	p2->next=NULL;
	return (end);
}
void print(struct student *end)
{
	struct student *p;
	p=end;
	do
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->grade,p->adress);
		p=p->before;
	}while(p!=NULL);
}
void main()
{
	struct student *end;
	end=creat();
	print(end);
}
struct student
{
	char num[20];
	char name[20];
	char sex[2];
	int age;
	float score;
	char add[50];
	struct student*next;
};
int n;
struct student*creat(void)
{
	int juge=1;
	struct student *head;
	struct student *p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(LEN);
	scanf("%s",p1->num);
	scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->add);
	head=NULL;
	while(1)
	{
		
		head=p1;
		n=n+1;
		if(n==1)
		p1->next=NULL;
		
		if(n>1)
		{
			p1->next=p2;
			p2=p1;
			head=p1;
		}
		   p1=(struct student*)malloc(LEN);
		   scanf("%s",p1->num);
		   
		   juge=strcmp(p1->num,"end");
		   if(juge==0)break;
		   scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->add);
		   

		
	}

	return(head);
}
void print(struct student*head)
{
   struct student*p;
   p=head;
   if(head!=NULL)
   while(p!=NULL)
   {
     printf("%s %s %s %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
	 p=p->next;
   }
}
void main()
{
	struct student *p;
	p=creat();
	print(p);
}
struct info{
	char num[10];
	char name[20];
	char sex;
	int age;
	float grade;
	char address[10];
	struct info *link;
};
int main(){
	struct info *p1,*p2;
	p1=p2=NULL;
	p1=(struct info *)malloc(sizeof(struct info));
	scanf("%s",p1->num);
	if(p1->num[0]=='e') return 0;
	do{
		scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->age,&p1->grade,p1->address);
		p1->link=p2;
		p2=p1;
		p1=(struct info *)malloc(sizeof(struct info));
		scanf("%s",p1->num);
	}while(p1->num[0]!='e');
	while(p2!=NULL){
		printf("%s %s %c %d %g %s\n",p2->num,p2->name,p2->sex,p2->age,p2->grade,p2->address);
		p1=p2->link;
		p2=p1;
	}
	return 0;
}
struct info
{
	char id[30];
	char name[30];
	char gen;
	int age;
	float grade;
	char add[30];
	struct info *next;
};
int n;

struct info *creat(void)
{
	struct info *head;
	struct info *p1;
	n=0;
	head=p1=(struct info*)malloc(LEN);
	scanf("%s",&p1->id);
	while(strcmp(p1->id,"end"))
	{   scanf("%s %c %d %f %s",&p1->name,&p1->gen,&p1->age,&p1->grade,&p1->add);
		n=n+1;
		if(n==1) {head=p1;p1->next=NULL;}
		else p1->next=head;
		head=p1;
		p1=(struct info*)malloc(LEN);
        scanf("%s",&p1->id);
	};
	return(head);
}

void print(struct info *head)
{
	struct info *p;
	p=head;
	if(head!=NULL)
		do
		{
			printf("%s %s %c %d %g %s\n",p->id,p->name,p->gen,p->age,p->grade,p->add);
		    p=p->next;
		}while(p!=NULL);
}

void main()
{
	struct info *head;
	head=creat();
	print(head);
}
struct stu* create();
struct stu{
		char text[100];
		struct stu *prev;
	};
int main()
{
	struct stu *p;
	p=create();
	while (p){
         printf("%s\n", p->text);
         p = p->prev;
   }
	return 0;
}	

struct stu* create(){
	struct stu *p1,*p2,*start;
	p1 = (struct stu *)malloc(sizeof(struct stu));
    gets(p1->text);
    if (p1->text == "end" ){   
		free(p1);
        start = NULL;
        return start;  //?????
     }
	else{
		p1->prev = NULL;
		start = p1;
		p2 = p1;
		do{  
			p1 = (struct stu *)malloc(sizeof(struct stu));
			start=p2;
			gets(p1->text);
			if ( strcmp(p1->text,"end")==0 ){ 
				free(p1);
				break;
			}
			else{
				p1->prev = p2;
				p2 = p1;
			}
		}	while (1);
		return start;   //?????
	}
}
struct student
{
    char num[16];
    char a[64];
    struct student *next;
};
int n;
 
struct student *creat(void)
{
    struct student *head,*p,*q;
    n=0;
    p=q=(struct student *)malloc(len);
    scanf("%s",p->num);
    head=null;
    while(strcmp(p->num,"end")!=0)
    {
        gets(p->a);
        n++;
        if(n==1)head=p,p->next=null;
        else head=p,p->next=q;
        q=p;
        p=(struct student *)malloc(len);
        scanf("%s",p->num);
    }
    return(head);
}
 
void print(struct student *head)
{
    struct student *p;
    p=head;
    int i;
    for(i=0;i<n;i++)
    {
        printf("%s",p->num);
        puts(p->a);
        p=p->next;
    }
}
 
void main()
{
    struct student *head;
    head=creat();
    print(head);
}
struct student 
{char num[20];
char name[20];
char sex;
int age;
char score[20];
char add[20];
};
int main()
{int i=0,s=0;
int t=0;
struct student stu[1000];
scanf("%s",stu[0].num);
while(stu[i].num[0]!='e'){
scanf("%s %c %d %s %s",stu[i].name,&stu[i].sex,&stu[i].age,stu[i].score,stu[i].add);
i++;
s++;
scanf("%s",stu[i].num);
}
for(i=s-1;i>=0;i--){
printf("%s %s %c %d %s %s\n",stu[i].num,stu[i].name,stu[i].sex,stu[i].age,stu[i].score,stu[i].add);
}
return 0;
}
struct student
{
	char c[100];
	struct student*next;
};
struct student*creat()
{
	struct student*p1,*p2,*p;
	int i;
	p1=p2=(struct student*)malloc(sizeof(struct student));
	p=p1;
	gets(p1->c);
	while(strcmp(p1->c,"end")!=0)
	{
		p1=(struct student*)malloc(sizeof(struct student));
		gets(p1->c);
		if(strcmp(p1->c,"end")==0) break;
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	return p;
}
struct student*change(struct student*p)
{
	struct student*p1,*p2,*p3;
	p1=p;
	p2=p;
	p3=NULL;
	while(p1->next!=NULL)
	{
		p2=p1->next;
		p1->next=p3;
		p3=p1;
		p1=p2;
	}
	p1->next=p3;
	return(p1);
}
void print(struct student*p)
{
	struct student *p1,*p2;
	p1=p;
	while(p1!=NULL)
	{
		printf("%s\n",p1->c);
		p1=p1->next;
	}
}
void main()
{
	struct student *p,*p1;
	p=creat();
	p=change(p);
	print(p);
}
struct stu
{
	char inf[50];
	struct stu *next;
} a[500];
int main()
{
//	struct stu *head,*point;
	int sum=0,i=0,j;
//	point=(struct stu *)malloc(sizeof(struct stu));
	
	while(gets(a[i].inf)!=NULL)
	{
		i++;

	}
	for(j=i-2;j>=0;j--)
	{
		puts(a[j].inf);
	}
	return 0;
}
struct student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char grade[20];
	char address[20];
	struct student *next;
};
struct student stud[200];
struct student * input()
{
	struct student *head,*p;
	head=NULL;
	p=(struct student *)malloc(LEN);
	scanf("%s",p->num);
	while(strcmp(p->num,"end")!=0)
	{
		scanf("%s %c %d %s %s",p->name,&p->sex,&p->age,p->grade,p->address);
		p->next=head;
		head=p;
		p=(struct student *)malloc(LEN);
		scanf("%s",p->num);
	}
	return(head);
}
void output(struct student *head)
{
	struct student *p;
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->grade,p->address);
		p=p->next;
	}
}
main()
{
	struct student *head;
	head=input();
	output(head);
	return 0;
}
struct student
{
	char message[300];
	struct student *next;
};
int n;

struct student *creat(void)
{struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=(struct student*)malloc(LEN);
gets(p1->message);
head=NULL;
while(strcmp(p1->message,"end")!=0)
{
    n=n+1;
	if(n==1)head=p1;
	else p1->next=p2;
	p2=p1;
	p1=(struct student*)malloc(LEN);
	gets(p1->message);
}
head->next=NULL;
return(p2);
}
void print(struct student *head)
{
	struct student*p;
	p=head;
	if(head!=NULL)
		do
		{
			printf("%s\n",p->message);
			p=p->next;
		}
		while(p!=NULL);
}



	 void main()
{ 
		 struct student *head;
head=creat();
print(head);
}
struct student{
	char num[100];
	char name[100];
	char sex;
	int old;
	float score;
	char add[150];
	struct student *next;
};

void main()
{
	struct student *p1,*p2;
	int len=sizeof(struct student);
	p1=(struct student *)malloc(len);
	p1->next=NULL;
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0){
		scanf("%s %c %d %g %s",p1->name,&p1->sex,&p1->old,&p1->score,p1->add);
		p2=p1;
		p1=(struct student *)malloc(len);
		p1->next=p2;
		scanf("%s",p1->num);
	}
	while(p1->next!=NULL){
		p1=p1->next;
		printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->sex,p1->old,p1->score,p1->add);
	}
}
struct student
{
 char inf[1000];
 struct student *pNext;       
};
int main()
{
  int i,j,k,l,m,n;
  int count=0;
  struct student a[1000],*pHeader,*p;
  for(i=0;;i++)
  {
    gets(a[i].inf);
    count=count+1;
    if(strcmp(a[i].inf,"end")==0)
    break;             
  }
  pHeader=&a[count-2];
  for(i=count-2;i>=1;i--)
  {
    a[i].pNext=&a[i-1];                       
  }
  a[0].pNext=NULL;
  p=pHeader;
  while(p!=NULL)
  {
    puts(p->inf);
    p=p->pNext;
  }              
}
struct student
{
	char a[100];
	struct student *next;
};

int main()
{
	struct student *p1,*p2;
	p1=(struct student*)malloc(len);
	p1->next=NULL;
	gets(p1->a);
	while((strcmp(p1->a,"end"))!=0)
	{
		p2=p1;
		p1=(struct student*)malloc(len);
		p1->next=p2;
		gets(p1->a);
	}
	p1=p1->next;
	while(p1!=NULL)
	{
		printf("%s\n",p1->a);
		p1=p1->next;
	}
	return 0;
}
struct stu
{char num[9];
 char nam[50];
 char s;
 int old;
 double sco;
 char add[18];
 struct stu *next;
 struct stu *abv;
};
void main()
{struct stu*head,*p1,*p2;
 int i=0;
 head=NULL;
 do
 {p1=(struct stu*)malloc(LEN);
  scanf("%s",&p1->num);if(!strcmp(p1->num,"end"))break;
  scanf("%s %c %d %lf %s",&p1->nam,&p1->s,&p1->old,&p1->sco,&p1->add);
  if(i==0){head=p1;p1->abv=NULL;}
  else {p1->abv=p2;}
  p2=p1;
  i++;
 }while(1);
 p1=p2;
 do
 {if(p1->sco-(int)p1->sco==0)
  printf("%s %s %c %d %.0lf %s\n",p1->num,p1->nam,p1->s,p1->old,p1->sco,p1->add);
  else
  printf("%s %s %c %d %.1lf %s\n",p1->num,p1->nam,p1->s,p1->old,p1->sco,p1->add);
  p1=p1->abv;
 }while(p1!=NULL);
}
int n;

struct student{char stu[50];struct student *next;};
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(LEN);
	gets(p1->stu);
	head=NULL;
	while(strcmp(p1->stu,"end")!=0)
	{
		n=n+1;
		if(n==1)head=p1;
		else p2-> next=p1;
		p2=p1;
		p1=(struct student*)malloc(LEN);
		gets(p1->stu);
	}
	p2-> next=NULL;
	return(head);
}

struct student *reverse(struct student *head)
{
	struct student *p1,*p2,*p3;
	p2=head;p3=head->next;
	do
	{
		p1=p2;p2=p3;p3=p2->next;p2->next=p1;
	}while(p3!=NULL);
	head->next=NULL;
	return(p2);
}

void print(struct student *head)
{
	struct student *p;
	p=head;
	if(head!=NULL)
	while(p)
	{
		if(p->stu!="end")
			printf("%s\n",p->stu);
		p=p->next;
	}
}

int main()
{
	struct student *head;
	head=creat();
	head=reverse(head);
	print(head);
        return 0;
}
struct student
{
	char num[100];
	char name[100];
	char gender[2];
	char age[100];
	char score[100];
	char add[100];
	struct student *next;
};

struct student *creat(void)
{
	struct student *head,*p1;
	head=NULL;
	while(1)
	{
		p1=(struct student*)malloc(LEN);
		scanf("%s",p1->num);
		p1->next=head;
		if(strcmp(p1->num,"end")==0)
			break;
		scanf("%s%s%s%s%s",p1->name,p1->gender,p1->age,p1->score,p1->add);
		head=p1;
	}
	return(head);
}
void print(struct student *head)
{
	struct student *p;
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %s %s %s %s\n",p->num,p->name,p->gender,p->age,p->score,p->add);
		p=p->next;
	}
}
void main()
{
	struct student *po;
	po=creat();
	print(po);
}







/*?????????????????????????????????????? 

 
???? 
????????????????????? 
00630018 zhouyan m 20 10.0 28#460 

??????"end"??
 
???? 
???????? 

?? ?? ?? ?? ?? ?? 

???????
 
???? 
00630018 zhouyan m 20 10 28#4600
0063001 zhouyn f 21 100 28#460000
0063008 zhoyan f 20 1000 28#460000
0063018 zhouan m 21 10000 28#4600000
00613018 zhuyan m 20 100 28#4600
00160018 zouyan f 21 100 28#4600
01030018 houyan m 20 10 28#4600
0630018 zuyan m 21 100 28#4600
10630018 zouan m 20 10 28#46000
end

 
???? 
10630018 zouan m 20 10 28#46000
0630018 zuyan m 21 100 28#4600
01030018 houyan m 20 10 28#4600
00160018 zouyan f 21 100 28#4600
00613018 zhuyan m 20 100 28#4600
0063018 zhouan m 21 10000 28#4600000
0063008 zhoyan f 20 1000 28#460000
0063001 zhouyn f 21 100 28#460000
00630018 zhouyan m 20 10 28#4600*/
struct student
{
	char num[1000];
	char name[1000];
	char sex;
	int age;
	char score[1000];
	char add[1000];
	struct student*next;
	struct student*pre;
};
int n;
struct student*creat()
{
	struct student*head,*end;
	struct student*p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(LEN);
	head=NULL;
   scanf("%s",p1->num);
	while(p1->num[0]!='e')
	{  	scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		n=n+1;
		if(n==1){head=p1;p1->pre=NULL;}
		else {p2->next=p1;p1->pre=p2;}
		p2=p1;
		p1=(struct student*)malloc(LEN);
	   scanf("%s",p1->num);
	}
	p2->next=NULL;
	end=p2;
	return(end);
}

void print(struct student*end)
{
	struct student*p;
	p=end;
	do
	{
		printf("%s %s %c %d %s %s",p->num,p->name,p->sex,p->age,p->score,p->add);
		printf("\n");
		p=p->pre;
	}while(p!=NULL);
}
int main()
{
	struct student *end;
	end=creat();
	print(end);
  return 0;
}
struct student
{
char info[100];
struct student *next;
struct student *former;};
int i,j,k,n;
void main()
{
struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=(struct student *)malloc(len);
gets(p1->info);
head=0;
while(strcmp(p1->info,"end")!=0)
{
n=n+1;
if(n==1) {head=p1;
p1->former=0;}         
else {p2->next=p1;
p1->former=p2;}
p2=p1;
p1=(struct student *)malloc(len);
gets(p1->info);  
}
p2->next=0;
p1=p2;

do{
puts(p2->info);
printf("\n");
p2=p2->former;}
while(p2!=0);
}