semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct xs
{
    char num[10];
    char name[30],sex[2],adr[100],grade[20];
    int year;
    struct xs *next;
};
struct xs *creat()// ?0?7?0?9×?0?0·?0?4 ?0?3?0?1 NULL ?0?4?0?1?0?7à?0?6?0?0?0?8?0?5?0?8×?0?8?0?1?0?0· 
{
    struct xs *head,*p1,*p2;
    p1=p2=(struct xs *)malloc(LEN);
    head=NULL;
    p1->next=NULL;
    int n=0;
   while(1)
    {
        n++;
        scanf("%s",p1->num);
        if(strcmp(p1->num,"end")==0){
            if(n==1)return NULL;
            else break; 
        }    
        SCAN;
        if(n==1)head=p1;
        else p2->next=p1;
        p2=p1;
        p1=(struct xs*)malloc(LEN);
    }
    p2->next=NULL;
    return head;
}
void output(struct xs* head)//?0?8×?0?8?0?1?0?0·NULL ?0?8?0?1?0?6?0?2?0?3?0?1?0?6?0?8?0?3?0?5 
{
    struct xs *p=head;
    if(p==NULL)printf("\n");
    else do
    {
    printf("%s %s %s %d %s %s\n",p->num,p->name,p->sex,p->year,p->grade,p->adr);
    p=p->next;
    }
    while(p!=NULL);
}
struct xs * change(struct xs*head)//?0?8×?0?8?0?1?0?0· NULL ?0?3?0?1 NULL 
{
    struct xs *p1,*p2,*p3;
    if(head==0)
        return 0;
    p1=NULL;
    p2=head;
    p3=p2->next;
    while(1)
    {
         p2->next=p1;
         if(p3==NULL){
             
             head=p2;
             p2->next=p1;
             break;
         }
         else {
             p1=p2;
             p2=p3;
             p3=p3->next;
         }     
                  
    }
    return head;
}    
int main()
{
    struct xs *head;
    head=creat();
    head=change(head);
    output(head);
    getchar();
    getchar();
    return 0;
}
struct s
{
char xh[50];
char xm[55];
char xb;
int nl;
char df[50];
char dz[50];
struct s *next;
};
void main()
{
struct s *head,*p1,*p2,*p;
p2=(struct s *)malloc(len);
scanf("%s",p2->xh);
p2->next=NULL;
while(strcmp(p2->xh,"end")!=0)
{
scanf("%s",p2->xm);
scanf(" %c",&p2->xb);
scanf(" %d",&p2->nl);
scanf(" %s",p2->df);
scanf(" %s",p2->dz);
head=p2;
p1=p2;
p2=(struct s *)malloc(len);
scanf("%s",p2->xh);
p2->next=p1;
}  
p=head;
while(p!=NULL)
{printf("%s %s %c %d %s %s\n",p->xh,p->xm,p->xb,p->nl,p->df,p->dz);
p=p->next;}


}
struct student
{
	char num[20];
	char name[30];
	char sex;
	int age;
	char score[20];
	char add[40];
	struct student *next;
};
void main()
{
	struct student *p1,*head;
	head=(struct student *)malloc(L);
	p1=head->next=NULL;
	scanf("%s",head->num);
	while(strcmp(head->num,"end")!=0)
	{
		p1=head;
		scanf(" %s %c %d %s %s\n",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		head=(struct student *)malloc(L);
		head->next=p1;
		scanf("%s",head->num);
	}
	free(head);
	head=p1;
	while(p1!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->next;
	}
}
struct student
{
	char id[50];
	char *name;
	char sex;
	short int age;
	float score;
	char *add;
	struct student *next;
};
int n;
struct student *creat(void)
{
	struct student *p1,*head,*p2;
	n=0;
	head=NULL;
	p2=p1=(struct student*)malloc(sizeof(struct student));
    gets(p1->id);
	while(strcmp(p1->id,"end")!=0)
	{
		n++;
		if(n==1) 
		p1->next=NULL;
		else 
		{   p1->next=p2;
		}
		p2=p1;
		head=p2;
		p1=(struct student*)malloc(sizeof(struct student));
		gets(p1->id);
	}
	return head;
}
void print(struct student *head)
{
	struct student *p;
	p=head;
    while(p!=NULL)
	{
		printf("%s\n",p->id);
		p=p->next;
	}
}
main()
{
	struct student *head;
	head=creat();
	print(head);
}
struct Student
{
   char imf[100];
   struct Student *next,*pre;    
};

int main()
{
    
    struct Student *p,*q,*h;
    
    h=p=q=malloc(LEN);
    gets(q->imf);
    q->pre=q->next=NULL;
    
    while(strcmp(q->imf,"end")!=0)
    {
       p=q;
       q=malloc(LEN);
       q->next=NULL;
       q->pre=p;
       p->next=q;
       gets(q->imf);                     
    }
    
    while(p!=NULL)
    {
      puts(p->imf);   
      p=p->pre;            
    }
}
struct student
{
	char s[10];
	char name[30];
	char sex;
	char age[3];
	char score[6];
	char place[15];
	struct student *next;
	struct student *last;
};
int n;
struct student *creat()
{
	struct student *head1,*head2;
	struct student *p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(100);
    head1=NULL;scanf("%s ",&p1->s);
	do
	{
		scanf("%s %c %s %s %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->place);
		n=n+1;
		if(n==1)
		{head1=p1;p1->last=NULL;}
		else {p2->next=p1;p1->last=p2;
		p2=p1;}p1=(struct student*)malloc(100);scanf("%s",&p1->s);
	}while(p1->s[0]!='e');head2=p2;
	p2->next=NULL;
	return(head2);
}
void main()
{
	struct student *p1;
	p1=creat();
	do{printf("%s %s %c %s %s %s\n",p1->s,p1->name,p1->sex,p1->age,p1->score,p1->place);
		p1=p1->last;
		}while(p1!=NULL);
}
struct stu
{
	char a[100];
	struct stu *prev;
	struct stu *next;
};
void main()
{
	struct stu *end,*p1,*p2,*head;
	int m,n,j;
	p1=(struct stu*)malloc(sizeof(struct stu));
	end=p1;
	p2=p1;
	gets(p1->a);
	p1->next=0;
	scanf("\n");
	for(;;)
	{
		p1=(struct stu*)malloc(sizeof(struct stu));
		gets(p1->a);
		scanf("\n");
		if(strcmp(p1->a,"end")==0)
		{
			head=p2;
			break;
		}
		else
		{
			p1->next=p2;
			p2=p1;
		}
	}
	for(;head!=0;head=head->next)
	{
		puts(head->a);
	}
}
struct student
 {
   char num[30];
   char name[40];
   char sex[2];
   int age;
   float score;
   char add[50];
   struct student *next;
 };
int n;
struct student *creat()
{
  struct student *head;
  struct student *p1,*p2;
  n=0;
  p1=p2=( struct student * ) malloc(LEN);
  scanf("%s",p1->num);
  head=0;
  while(strcmp(p1->num,"end")!=0)
  {
    scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->add);
	n++;
	if(n==1) p2->next=0;
	else p1->next=p2;
	p2=p1;
	p1=( struct student * ) malloc(LEN);
	scanf("%s",p1->num);
  }
  head=p2;
  
  return(head);
}
void print(struct student * head)
{
  struct student * p;
  p=head;
  if(head!=0)
	  do
	  {
		  printf("%s %s %s %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
		  p=p->next;
	  }while(p!=0);
}
void main()
{
    struct student *head;
	head=creat();
	print(head);
}
struct Student 
{ 
    char id[100]; 
    char name[300]; 
    int age; 
    char sex;                
    char score[100];
    char address[300];
    struct Student *before;
}s[2500];

main()
{
	struct Student *p,*q,*head;
	int i=0,j,k,n,m;
	scanf("%s",&s[0].id);
	p=&s[0];
	q=NULL;
	while (p!=NULL)
	{
		
		scanf("%s %c%d%s%s",p->name,&p->sex,&p->age,p->score,p->address);
		p->before=q;
		q=p;
		scanf("%s",&s[i+1].id);
		if (strcmp(s[i+1].id,"end")==0)
		{
			p=NULL;
			head=q;
		}
		else {
		p=&s[i+1];
		i++;
		}
	}
	p=head;q=NULL;
	while(p!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p->id,p->name,p->sex,p->age,p->score,p->address);
		p=p->before;
	}
	
}
struct stu
{	//????????
	char stunum[10];
	char name[20];
	char sex[3];
	char age[10];
	char mark[10];
	char add[20];
	struct stu *next,*before;//??
};

void main()
{
	struct stu *p,*pt,*head;
	int i=0,n=0;
	char a[4];
	strcpy(a, "end");
	pt=p=head=(struct stu *)malloc(Len);
	for(i=0;;i++)
	{
		scanf("%s",&p->stunum);
		if(strcmp(p->stunum,a)==0)
		{
			pt->next=NULL;break;
		}
		scanf("%s %s %s %s %s",&p->name,&p->sex,&p->age,&p->mark,&p->add);
		pt=p;
		p=(struct stu *)malloc(Len);
		pt->next=p;
		p->before=pt;
	}
	p=pt;
	if(p!=head)
	{
		for(i=0;;i++)
		{
			printf("%s %s %s %s %s %s",&p->stunum,&p->name,&p->sex,&p->age,&p->mark,&p->add);
			if(p==head)
				break;
			printf("\n");
			p=p->before;
		}
	}
	printf("\n");
}
struct stu{
	char name[20];
	char num[10];
	char x[5];
	int y;
	float f;
	char add[100];
	struct stu *next;
};

int main()
{
	struct stu *p1,*p2;

	p1=(struct stu *)malloc(sizeof(struct stu));

	p1->next=0;
	
	

	scanf("%s",p1->num);

	while(p1->num[0]!='e')
	{
		scanf("%s%s%d%f%s",p1->name,p1->x,&p1->y,&p1->f,p1->add);
		p2=p1;
		p1=(struct stu *)malloc(sizeof(struct stu));
		p1->next=p2;
		scanf("%s",p1->num);
	}

    p1=p1->next;
	printf("%s %s %s %d %g %s\n",p1->num,p1->name,p1->x,p1->y,p1->f,p1->add);
	while(p1->next!=0)
	{
		p1=p1->next;
		printf("%s %s %s %d %g %s\n",p1->num,p1->name,p1->x,p1->y,p1->f,p1->add);
	}

	return 0;
}
struct Student
{
    char stu[500];
    struct Student * next;
};

int n=0;
void main()
{
    struct Student * creat();
    void print(struct Student *head,int num);
    struct Student *head;
    head=creat();
    int i=0;
    for(i=n;i>0;i--)
        print(head,i);
}

struct Student * creat()
{
    struct Student *p1,*p2;
    struct Student *head;
    head=NULL;
    p1=p2=(struct Student *)malloc(LEN);
    gets(p1->stu);
    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);
}

void print(struct Student *head,int num)
{
    struct Student *p;
    p=head;
    int count=1;
    while(count<num)
    {
        p=p->next;
        count+=1;
    }
    printf("%s\n",p->stu);
}
main()
{
   struct h
   {char mun[10];
    char name[20];
    char sex;
    int age;
    float score;
    char add[20];
    struct h *p;
   } ;

   struct h *a,*b;  
   a=len;
   a->p=NULL;
   int i;
   for(i=0;i<1000;i++)
   {scanf("%s",a->mun);
	if(!strcmp(a->mun,"end")) break;
    scanf("%s %c %d %f %s",a->name,&a->sex,&a->age,&a->score,a->add);
   b=len;
   b->p=a;
   a=b;}
   a=a->p;
   while(a)
   {
     printf("%s %s %c %d %g %s\n",a->mun,a->name,a->sex,a->age,a->score,a->add);
     a=a->p;
   }
  
}
struct student
{
	char inf[200];
	struct student *next;
};
int n;
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	n=0;
	p1=(struct student *)malloc(LEN);
	p2=p1;
	gets(p1->inf);
	head=NULL;
	do
	{
		n=n+1;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		gets(p1->inf);
	}
	while(strcmp((p1->inf),"end")!=0);
	p2->next=NULL;
	return(head);
}
int main()
{
	struct student *r,*headr;
	r=creat();
	headr=r;
	r=r->next;
	for(;r!=headr;)
	{
		for(r=headr;r->next!=NULL;)r=r->next;
		printf("%s\n",r->inf);
		for(r=headr;(r->next)->next!=NULL;)r=r->next;
		r->next=NULL;
	}
	printf("%s",headr->inf);
}
struct student
{
	char infor[100];
		struct student *next;
};

struct student *creat(void)
{  struct student *head;
       struct student *p1,*p2;
         int n;
		 char l[4]={"end"};
		 n=0;
       p1=p2=(struct student *)malloc(LEN);
      gets(p1->infor);
       head=NULL;
       while(strcmp(p1->infor,l)!=0)
	   {   n=n+1;
           if(n==1) head=p1;
           else p2->next=p1;
              p2=p1;
             p1=(struct student *)malloc(LEN);
            gets(p1->infor);
	   }
           p2->next=NULL;
        return(head);
}
void print(struct student *head)
{
	struct student *p,*p1,*p2;
	p=p1=p2=head;
	p2=p->next;
	p1=p2->next;
	head->next=NULL;
	for(;p1->next!=NULL;)
	{
	p2->next=p;
	p=p2;
	p2=p1;
	p1=p1->next;
	}
	p2->next=p;
	p1->next=p2;
	head=p1;
	p=head;
	for(;p!=NULL;)
	{printf("%s\n",p->infor);
      p=p->next;
	}
}
void main()
{
	struct student *head;
	head=creat();
	print(head);
}
int n=1;
struct student
{char num[20];
char name[20];
char sex;
int age;
char score[10];
char ad[20];
struct student *next;
};
struct student* appendnewnode(void)
{
	struct student *newnode,*thisnode;
	int x;
    do{
		newnode=(struct student*)malloc(sizeof(struct student));
		scanf("%s",newnode->num);
		getchar();
		x=strcmp(newnode->num,"end");
		if(x!=0){
			scanf("%s %c %d %s %s",newnode->name ,&newnode->sex ,&newnode->age ,newnode->score ,newnode->ad);
		if(n==1)
		{
			newnode->next =0;
		}
		else
		{
			newnode->next =thisnode;
		}
		thisnode=newnode;
		n++;
		}
	}while(x!=0);
	return(thisnode);
}
void main()
{
	struct student *p,*head;
	head=appendnewnode();
	p=head;
	do
	{
		printf("%s %s %c %d %s %s\n",p->num ,p->name ,p->sex ,p->age ,p->score ,p->ad);
	    p=p->next ;
	}while(p!=NULL);
}
struct Student{
	char stu[100];
	struct Student *next;
};
int main()
{
	struct Student *p,*head,*p1,*p2;
	int n = 0;
	p2 = p1 = (struct Student *)malloc(Len); 
	head = NULL;
	gets(p1->stu);
	while(strcmp(p1->stu,"end")!=0){
		n++;
		head = p1;
		if (n==1) p1->next = NULL; 
		else{
			p1->next = p2;
		    p2 = p1;
		}
		    p1 = (struct Student *)malloc(Len);
		    gets(p1->stu); 
	}
    
    p = head;
    if (head != NULL){
		do{
			puts(p->stu);
			p=p->next;
		}while(p != NULL);
	}
	
	return 0;
}
struct xinxi
{
	char stu[1000];
	struct xinxi *next;
};
void main()
{
	struct xinxi *head,*p,*pt;
	int i,n;

	p=(struct xinxi *)malloc(sizeof(struct xinxi));
	gets(p->stu);
	pt=p;
	head=(struct xinxi *)malloc(sizeof(struct xinxi));
	n=0;
	while(strcmp(p->stu,"end")!=0)
	{   n=n+1;
		if(n==1)head->next=p;
		if(n>1)pt->next=p;

		pt=p;
		p=(struct xinxi *)malloc(sizeof(struct xinxi));
		n=n+1;
        gets(p->stu);
	}
	pt->next=NULL;

while(head->next!=NULL)
	{	pt=head;
	p=head->next;
	while(p->next!=NULL)
	{p=p->next;
	pt=pt->next;}

	puts(p->stu);
	pt->next=NULL;
	}
}
struct stu
{
     char inf[100];       
     struct stu *next;
};


void down(struct stu *now)
{
     if (now->next!=0) down(now->next);
     if (now->next!=0) printf("%s\n",now->inf);
}


int main()
{
    void down(struct stu *now);
    struct stu *head,*now,*neww;
    head=(struct stu*) malloc(sizeof(struct stu));
    head->next=0;
    gets(head->inf);
    now=head;   
     do
     {
       neww=(struct stu*) malloc(sizeof(struct stu));
       neww->next=0;
       gets(neww->inf);
       now->next=neww;
       now=neww;
                                         //      printf("%s\n",now->inf);
       
     }while (strcmp(now->inf,"end")!=0);
    down(head);
 //   int i;scanf("%d",&i); 
    return 0;
}
struct student
{
	char id[10];
	char name[20];
	char sex[2];
	int age;
	char s[10];
	char add[20];
	struct student *next;
};
struct student *creat(void)
{       
	struct student *head,*p1,*p2;
	int i=0;
	p1=p2=(struct student*)malloc(LEN);    
	head=NULL;       
	while(scanf("%s",p1->id)&&*p1->id>=48&&*p1->id<=57)     
	{                         
		scanf("%s%s%d%s%s",p1->name,p1->sex,&p1->age,p1->s,p1->add);
		if(i==0)head=p1;            
		else p2->next=p1;              
		p2=p1;           
		p1=(struct student *)malloc(LEN); 
		i++;
	} 
	p2->next=NULL;    
    return (head);
}
void turn(struct student *head)
{
	struct student *p1,*p2;
	p2=p1=head;
	while(head->next!=NULL)
	{
		while(p1->next!=NULL)
		{
			p2=p1;
			p1=p1->next;
		}
		printf("%s %s %s %d %s %s\n",p1->id,p1->name,p1->sex,p1->age,p1->s,p1->add);
		p2->next=NULL;p1=head;
	}
printf("%s %s %s %d %s %s\n",p1->id,p1->name,p1->sex,p1->age,p1->s,p1->add);
}		
void main()
{
	struct student *head;
	head=creat();
	turn(head);
}
struct stu
{
       char x[300];
       struct stu *next;
};

void creat1(struct stu *head,char *p)           //?????
{
     struct stu *pre,*p1,*s;
     s=(struct stu *)malloc(sizeof(struct stu));
     strcpy(s->x,p);
     pre=head;
     p1=pre->next;
     pre->next=s;
     s->next=p1;
}

void creat2(struct stu *head,char *p)           //?????
{
     struct stu *pre,*p1,*s;
     s=(struct stu *)malloc(sizeof(struct stu));
     strcpy(s->x,p);
     pre=head;
     p1=pre->next;
     for(;p1!=NULL;)
     {
                   pre=p1;
                   p1=p1->next;
     }
     pre->next=s;
     s->next=p1;
}

int main()
{
    int i,j,k,m,n;
    char *p;
    p=(char *)malloc(300*sizeof(int));
    struct stu *head,*s;
    head=(struct stu *)malloc(sizeof(struct stu));
    head->next=NULL;
    for(i=0;;i++)
    {
                 gets(p);
                 if(*(p+0)=='e')
                 {
                                break;
                 }
                 else
                 {
                     creat1(head,p);
                 }
    }
    s=head->next;
    for(;s!=NULL;)
    {
                  puts(s->x);
                  s=s->next;
    }
    return 0;
}
main()
{
	char s[1000][1000];
	int i=0,n=0;
	while(1)
	{
		gets(s[n]);
		if(s[n][0]=='e')
		break;
		else
		n++;
	}
	for(i=n-1;i>=0;i--)
	{puts(s[i]);printf("\n");}
}
// ??????????.cpp : ??????????????
//


struct student
{
	char info[100];
	struct student *pre;
};

struct student *creat()
{
	struct student *p1,*p2,*head;
	p1=(struct student*)malloc(L);
	gets(p1->info);
	if(strcmp(p1->info,"end")==0) 
	{
		return(NULL);
		exit;
	}
	else 
	{
	    p2=NULL;
	    for(int i=1;;i++)
	    {
		    p1->pre=p2;
		    p2=p1;
		    p1=(struct student*)malloc(L);
		    gets(p1->info);
		    if(strcmp(p1->info,"end")==0) break;
	    }
	    p1->pre=p2;
	    head=p1->pre;
	    return(head);
    }
}

int main()
{
	struct student *p;
	p=creat();
	while(p!=NULL)
	{
		printf("%s\n",p->info);
		p=p->pre;
	};
	return 0;
}
struct student
{
	char num[10];
	char name[30];
	char sex[2];
	char age[5];
	char score[10];
	char add[20];
	struct student *prev;
};
struct student *create(void)
{
	struct student *p1,*p2;	
	p1=(struct student *)malloc(sizeof(struct student));
	scanf("%s",p1->num);
	if(strcmp(p1->num,"end"))
	{
		scanf("%s%s%s%s%s",p1->name,p1->sex,p1->age,p1->score,p1->add);
		p2=p1;
		p1->prev=NULL;
	}
	while(strcmp(p1->num,"end"))
	{
		p1=(struct student *)malloc(sizeof(struct student));
		scanf("%s",p1->num);
		if(strcmp(p1->num,"end"))
		{
			scanf("%s%s%s%s%s",p1->name,p1->sex,p1->age,p1->score,p1->add);			
			p1->prev=p2;
			p2=p1;
		}
	}
	return(p2);
}
void main()
{
	struct student *p1;
	p1=create();
	while(p1!=NULL)
	{
		printf("%s %s %s %s %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->prev;
	}
}
struct student
{
	char num[200];
	struct student *next;
};
void main()
{
	int n,i,k,j;
	    struct student *head;
		struct student *p1,*p2;
		struct student *newhead,*nnew;
		n=0;
		p1=p2=(struct student *)malloc(sizeof(struct student));
		gets(p1->num);
		head=NULL;
		while(strcmp(p1->num,"end")!=0)
		{
			n=n+1;
			if(n==1)
				head=p1;
			else
				p2->next=p1;
			p2=p1;
			p1=(struct student *)malloc(sizeof(struct student));
			gets(p1->num);
		}
		p2->next=NULL;
		for(i=0;i<n;i++)
		{
			p2=p1=head;
			while(p1->next!=NULL)
			{
				p2=p1;
				p1=p1->next;
			}
			if(i==0)
				newhead=nnew=p1;
			else
				nnew=nnew->next=p1;
			p2->next=NULL;
		}
		p1=newhead;
		for(i=0;i<n;i++)
		{
			printf("%s",p1->num);
			p1=p1->next;
			printf("\n");
		}
}
struct stu
{
	char information[100];//????????????????????????????
	struct stu*next;//??????
	struct stu*last;//??????????????????????????
};
struct stu*creat(void)
{   struct stu *end,*p1,*p2;
    int flag=1;
	p1=(struct stu*)malloc(Len);
	gets(p1->information);
	if(strcmp(p1->information,"end")==0) //??????????????
	{	p2=null; flag=0;}
	else 
	{
	    p1->last=null;//?????????????
	   do
	   {
		p2=p1;
		p1=(struct stu*)malloc(Len);
		p2->next=p1; //????????????
		p1->last=p2;//?????????????????
	    gets(p1->information);
		if(strcmp(p1->information,"end")==0) flag=0;//??end???????
	    }while(flag==1);
	}
	end=p2;
	return end;
}
void printf(struct stu*end)
{
	struct stu* p;
	p=end;
	while(p!=null)
	{
		 printf("%s\n",p->information);
		 p=p->last;//???????????
	}
}

int main()
{
	struct stu *move;
	move=creat();
	printf(move);
}
struct student{
               char info[100];
               struct student *before;
               }student[10000];

int main()
{
    void print(struct student *p);
    int i=0,j;
    char a[10000][100];
    gets(a[0]);
    while(a[i][0]!='e'){
                        strcpy(student[i].info,a[i]);
                        i++;
                        gets(a[i]);
                        }
    student[0].before=NULL;
    for(j=0;j<=i-1;j++){
                      student[j+1].before=&student[j];
                      }
    print(&student[i-1]);
    return 0;
    }

void print(struct student *p)
{
     printf("%s\n", p->info);
     if(p->before!=NULL){print(p->before);}
     }
//???
int main()
{
   struct student
   {
      char id[200];
	  char name[200];
	  char sex;
	  int age;
	  double score;
	  char add[200];
   }stu[1000];
   int i=0;
   while(cin>>stu[i].id)
   {
	   if(strcmp(stu[i].id,"end")==0)
		   break;
	   else 
		   cin>>stu[i].name>>stu[i].sex>>stu[i].age>>stu[i].score>>stu[i].add;
	   i++;
   }
   int j=i;
   for(j=i-1;j>=0;j--)
   {
	   cout<<stu[j].id<<' '<<stu[j].name<<' '<<stu[j].sex<<' '<<stu[j].age<<' '<<stu[j].score<<' '<<stu[j].add<<endl; 
   }
   return 0;
}
struct student
{
	char inf[100];
	struct student *next;
	struct student *last;
};
int n;
struct student *end;
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(LEN);
	gets(p1->inf);
	head=NULL;
	while(1)
	{
		n=n+1;
		if(n==1)head=p1;
		else {p2->next=p1;p1->last=p2;}
		p2=p1;
		p1=(struct student*)malloc(LEN);
	    gets(p1->inf);
		if((p1->inf)[0]=='e') break;
	}
	head->last=NULL;
	p2->next=NULL;
	end=p2;
	return(head);
}
main()
{
	struct student *head;
	struct student *p1,*p2;
	head=creat();
	p1=end;
	while(p1!=NULL)
	{
		p2=p1;
		puts(p1->inf);
		p1=p2->last;
	}
}
struct student
{
	char num[100];
	char name[100];
	char sex;
	int age;
	char score[20];
	char address[100];
	struct student *next;
};
struct student *creat()
{
	struct student *head,*p1,*p2;
	p1 = (struct student*)malloc(len);
    p2 = p1;
	scanf("%s",p1->num);
    if(strcmp(p1->num,"end") == 0)
	{head = p1;p1->next = NULL;}
	else
	{
	scanf(wtf);
	p1->next = NULL;
	for (;;)
	{
      p1 = (struct student*)malloc(len);
	  scanf("%s",p1->num);
	  if(strcmp(p1->num,"end") == 0)
		  break;
	  scanf(wtf);
	  p1->next = p2;
	  p2 = p1;
	}
	head = p2;
	}
	return(head);
}
main()
{
	struct student *p;
	p = creat();
	if (p->next == NULL)
		printf("\n");
	else
	{
	for(;p!=NULL;)
	{
		printf(wtf2);
		p = p->next;
	}
	}
}
int main(){
int i,n;
struct information{
char num[20];
char name[20];
char sex;
int age;
char score[100];
char address[20];
}stu[1000];         //????
for(i=0;i<1000;i++){
	cin>>stu[i].num;
	if((stu[i].num[0]=='e')&&(stu[i].num[1]=='n')&&(stu[i].num[2]=='d')){
		n=i-1;
		break;}   //???end?????
	else{
	cin>>stu[i].name;
	cin>>stu[i].sex;
	cin>>stu[i].age;
	cin>>stu[i].score;
	cin>>stu[i].address;}
}           //????
for(i=n;i>=0;i--){
	cout<<stu[i].num<<" "<<stu[i].name<<" "<<stu[i].sex<<" "<<stu[i].age<<" "<<stu[i].score<<" "<<stu[i].address<<endl;
}       //????
return 0;
}
char ss[]={'e','n','d'};
int n=0;
struct st
{
	char s[200];
	struct st *next1;
};
void main()
{
	struct st *p;
	struct st *creat(void);
	int i=0;
	struct st *head;
	struct st *p1,*p2;
	p1=p2=(struct st *)malloc(len);
	p1->next1=NULL;
	gets(p1->s);
	head=p1;
	while(1)
	{
		n++;
		if(n==1)head=p1;
		p2=p1;
		p1=(struct st *)malloc(len);
		gets(p1->s);
		p1->next1=p2;
		if(strcmp(p1->s,ss)==0)
		{
			break;
		}
	}
	head->next1=NULL;
	for(i=0;i<n;i++)
	{
		printf("%s\n",p2->s);
		p2=p2->next1;
	}
}
struct stu{
	char num[20];
	char name[20];
	char gender;
	int age;
	float score;
	char address[20];
	struct stu *next;
};

struct stu *creat()
{
	struct stu *head,*p1,*p2;
	head=p1=p2=(struct stu *)malloc(LEN);
	head->next=NULL;
	scanf("%s",p1->num);
	SCAN;
	for(;;)
	{   
	    p1=(struct stu *)malloc(LEN);
		scanf("%s",p1->num);
	    if(p1->num[0]!='e')
		{SCAN;
	     p1->next=p2;
  	     p2=p1;}
        else
        {break;}
	}
	return(p2);
}

int main()
{
	struct stu *p,*t;
	t=creat();
	for(p=t;p!=NULL;p=p->next)
	printf("%s %s %c %d %g %s\n",p->num,p->name,p->gender,p->age,p->score,p->address);
}
struct student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	float grade;
	char addr[100];
	struct student *next;
};
struct student *creat()
{
	struct student *pt,*pn;
	pn=(struct student *)malloc(sizeof(struct student));
	pt=0;
	scanf("%s",pn->num);
	pn->next=0;
	while(pn->num[0]!='e')
	{
		scanf("%s %c %d %f %s",pn->name,&pn->sex,&pn->age,&pn->grade,pn->addr);
		pt=pn;
		pn=(struct student *)malloc(sizeof(struct student));
		pn->next=pt;
		scanf("%s",pn->num);
	}
	return(pt);
}
int main()
{
	struct student *head,*p;
	head=creat();
	p=head;
	while(p!=0)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->grade,p->addr);
		p=p->next;
	}
	return 0;
}