semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct student
{
	char num[100];
	char name[100];
	char sex;
	int age;
	float score;
	char ad[100];
	struct student *next;
	struct student *former;
};
int n=1;
struct student *creat()
{
	struct student *thisnode,*newnode,*head;
	do
	{
	newnode=(struct student *)malloc(sizeof(struct student));
	scanf("%s",newnode->num);
	if(newnode->num[0]!='e')
	{
		scanf("%s %c%d%f%s",newnode->name,&newnode->sex,&newnode->age,&newnode->score,newnode->ad);
	   head=newnode;
	   if(n==1) newnode->former=NULL;
       else 
	   {
		thisnode->next=newnode;
		newnode->former=thisnode;
	   }
	   thisnode=newnode;
	   n=n+1;
	}
	else 
	{
		thisnode->next=NULL;
	}
	}while(newnode->num[0]!='e');
	return(head);
}
void main()
{
	struct student *p;
	p=creat();
	do
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->ad);
		p=p->former;
	}while(p!=NULL);
}
struct record
{
	char stuinfo[50];
	struct record *pnext;
};


int main()
{
	record *stu,*head,*ptemp;
	head=(struct record*)malloc(sizeof(struct record));
	head->pnext=NULL;
	ptemp=(struct record*)malloc(sizeof(struct record));
	stu= (struct record*)malloc(sizeof(struct record));
	gets(stu->stuinfo);
	while(strcmp(stu->stuinfo, "end")){
		if (head->pnext==NULL)
			{
				head->pnext=stu;
				stu->pnext=NULL;
		}
		else 
		{
			ptemp=head->pnext;
			head->pnext=stu;
			stu->pnext=ptemp;
		}
		stu= (struct record*)malloc(sizeof(struct record));
		gets(stu->stuinfo);		
	}
	ptemp=head;
	while(ptemp->pnext!=NULL){
		ptemp=ptemp->pnext;
		printf("%s\n", ptemp->stuinfo);		
	}

		
	return 0;
}
struct student
{
	char a[80];
	struct student *pro;
};

struct student *creat()
{
	struct student *end,*p1,*p2;
	p2=(struct student *)malloc(sizeof(struct student));
	gets(p2->a);
	p2->pro=NULL;
	p1=p2;
	do
	{
		p2=(struct student *)malloc(sizeof(struct student));
		gets(p2->a);
		if (strcmp(p2->a,"end")==0) 
		{
			free(p2);
			break;
		}
		else
		{
			p2->pro=p1;
			p1=p2;
			end=p2;
		}		
	}
	while(1);
	return(end);
}
void destroy(struct student *end)
{
	struct student *p;
	p=end;
	while(end)
	{
		p=end;
		end=end->pro;
		free(p);
	}
}
void main()
{
	struct student *creat();
	void destroy(struct student *end);
	struct student *end,*p;
	end=creat();
	p=end;
	do
	{
		puts(p->a);
		p=p->pro;
	}
	while (p);
	destroy(end);
}
struct student 
{  
       char ID[10];   
       char name[20],s;   
       int age;
       char score[10];   
       char ad[20];   
       struct student *next;
}; 
int main()
{   
    struct student *head;   
    int n,i,j;   
    n=0;
    head = NULL;  
    struct student *p1 ;
    while (1)   
    {     
          p1 = (struct student *)malloc(len);
          scanf("%s" , p1 -> ID);
          if (p1 -> ID[0] == 'e' && p1 -> ID[1] == 'n' && p1 -> ID[2] == 'd' ) break;
          scanf(" %s %c %d %s %s",p1->name,&p1->s,&p1->age,p1->score,p1->ad);  
          n++;     
          p1 -> next = head;
          head = p1; 
    }   
    p1 = head; 
    while (p1 != NULL)  
    {
        printf("%s %s %c %d %s %s\n",p1->ID,p1->name,p1->s,p1->age,p1->score,p1->ad);    
        p1 = p1 -> next;  
    }    

}
struct student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char mark[20];
	char add[20];
	struct student *next;
};
void main()
{
	struct student *creat(void);
	struct student *p;
	int m=0;
	p=creat();
	while(p!=NULL)
	{
		printf("%s %s %c %d %s %s\n",(*p).num,(*p).name,(*p).sex,(*p).age,(*p).mark,(*p).add);
		p=(*p).next;
	} ;
}
int n;
struct student *creat(void)
{   int k;
	n=0;
	struct student *head,*p1,*p2;
	p2=p1=(struct student *)malloc(sizeof(struct student));
	scanf("%s%s %c%d%s%s",(*p1).num,(*p1).name,&(*p1).sex,&(*p1).age,(*p1).mark,(*p1).add);
	while(p2!=NULL)
	{
		n=n+1;
		if(n==1)
		{(*p2).next=NULL;}
		else {(*p1).next=p2;}
		p2=p1;
		p1=(struct student *)malloc(sizeof(struct student));
		scanf("%s",(*p1).num);
		k=strcmp((*p1).num,"end");
		if(k==0)
		{break;}
		else if(k!=0)
		{
			scanf("%s %c%d%s%s",(*p1).name,&(*p1).sex,&(*p1).age,(*p1).mark,(*p1).add);
        }
	}
	return(p2);
}
//struct student
struct student
{
    char content[50];
    struct student *next;
};

int main()
{
    struct student *head,*p1,*p2,*p3,*h,*p4,*p5,*p6;
    int i,j,k;
    char s[16];
    s[0]='e';
    s[1]='n';
    s[2]='d';
    s[3]='\0';
    int m=0;
    p6=p4=p5=p3=p1=p2=(struct student *)malloc(sizeof(struct student));
    gets(p1->content);
    p4=p1;
    for(;strcmp(p1->content,s)!=0;)
    {
            p2=p1;
            p1=(struct student *)malloc(sizeof(struct student));
            p1->next=p2;
            gets(p1->content);
    }
    p4->next=NULL;
    p3=head=p1->next;
    m=0;
    for(;p3!=NULL;)
    {
                   m++;
                   if(m==1)
                   {
                           printf("%s",p3->content);
                   }
                   else
                   {
                           printf("\n%s",p3->content);
                   }
                   p3=p3->next;
    }
    return 0;
}
struct student
{
	char number[20];
	char name[20];
	char sex;
	int age;
	float score;
	char address[20];
	struct student *next;
}

main()
{
	int i,j,m,n=0;
	struct student *head,*p1,*p2,*p;
	p1=p2=(struct student *)malloc(LEN);
	for(i=0;;i++)
	{
		scanf("%s",p1->number);
		if(strcmp(p1->number,"end")==0)
		{
			break;
		}
		else
		{
			scanf("%s%*c%c%d%f%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->address);
			n+=1;
		}
		if(i==0)
		{
			head=p1;
		}
		else
		{
			p2->next=p1;
		}
		p2=p1;
		p1=(struct student *)malloc(LEN);
	}
	p2->next=NULL;
	m=n;
	for(i=0;i<n;i++)
	{
		p=head;
		for(j=0;j<m-1;j++)
		{
			p=p->next;
		}
		printf("%s %s %c %d %g %s\n",p->number,p->name,p->sex,p->age,p->score,p->address);
		m-=1;
	}
}
struct student
{
       char num[30];
       char name[30];
       char s[2];
       int age;
       float score;
       char add[30];
       struct student *next;
};
struct student *creat()
{
       int n=0;
       struct student *head;
       struct student *p1;
       struct student *p2;
       p1=p2=(struct student *)malloc(LEN);
       scanf("%s%s%s%d%f%s",p1->num,p1->name,p1->s,&p1->age,&p1->score,p1->add);
       p2->next=0;
       while(p1->num[0]!='e')
       {
           n=n+1; 
           if(n>1)
           p1->next=p2;
           p2=p1;head=p1;
           p1=(struct student *)malloc(LEN);
           scanf("%s%s%s%d%f%s",p1->num,p1->name,p1->s,&p1->age,&p1->score,p1->add);
       }
       return(head);
}
int main()
{
    struct student *p=creat();
     for(;;)
    {
       printf("%s %s %s %d %g %s\n",p->num,p->name,p->s,p->age,p->score,p->add);
       p=p->next;
       if(p==0)break;
    } 
}
void main()
{
	char s[1000][100];
	int i;
	for(i=0;;i++)
	{
		gets(s[i]);
		if(s[i][0]=='e')
		{
			i--;
			break;
		}
	}
	for(;i>=0;i--)
		printf("%s\n",s[i]);
}
struct student
{
	char num[10];
	char name[20];
	char sex[5];
	char age[5];
	char score[10];
	char adr[20];
	struct student *next;
};
struct student *creat(void)
{
	struct student *head;
    struct student *p1;
	head=p1=( struct student * ) malloc(LEN);
	scanf("%s%s%s%s%s%s",p1->num,p1->name,p1->sex,p1->age,&p1->score,p1->adr);
	p1->next=NULL;
    while(p1->num[0]!='e')
	{
		p1=( struct student * ) malloc(LEN);
		scanf("%s",p1->num);
	    if(p1->num[0]!='e')
		{
			scanf("%s%s%s%s%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->adr);
		    p1->next=head;
		    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->sex,p->age,p->score,p->adr);
		p=p->next;
	}
}
void main()
{
	struct student *h;
	h=creat();
	print(h);
}
struct student
{
	char xuehao[20];
	char name[50];
	char sex;
	int age;
	float score;
	char addr[100];
	struct student *next;
};
void main()
{
	struct student *p1,*p2,*head,*newhead,*p3;
	int i=1;
	long n=0;
	p1=p2=(struct student *)malloc(LEN);
	head=NULL;
	scanf("%s %s %c %d%f %s",p1->xuehao,p1->name,&p1->sex,&p1->age,&p1->score,p1->addr);
	while(i)
	{
		if(n==0)
		{head=p2=p1;n++;}
		else
		{
		p2->next=p1;p2=p1;
		p1=(struct student *)malloc(LEN);
		   scanf("%s",p1->xuehao);
		if(strcmp(p1->xuehao,"end")==0)
		{i=0;p2->next=NULL;}
		else {scanf("%s %c %d%f %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->addr);n++;}
		}
	}
	for(i=0;i<n;i++)
	{p2=p1=head;
	     while(p1->next!=NULL)
		 {p2=p1;
	      p1=p1->next;
		 }
         if(i==0)
			 newhead=p3=p1;
		 else
			 p3=p3->next=p1;
		 p2->next=NULL;
	}

	p2=newhead;
	for(i=0;i<n;i++)
	{	printf("%s %s %c %d ",p2->xuehao,p2->name,p2->sex,p2->age);
	    if((*p2).score==(int)(p2->score))
			printf("%d ",(int)p2->score);
		else printf("%.1f ",p2->score);
		printf("%s\n",p2->addr);
	    p2=p2->next;
	}
}
struct Student
{
char number[100];
char name[100];
char sex;
int age;
char score[20];
char address[100];
struct Student *next;
struct Student *front;
}; 
int n;
void main()
{
	struct Student*p1,*p2;
	n=0;
	p1=p2=(struct Student*)malloc(LEN);
	scanf("%s %s %c%d%s%s",&p1->number,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->address);
	p1->front=NULL;
	while(p1->number[0]!='e'||p1->number[1]!='n'||p1->number[2]!='d')
	{
			n=n+1;
			p2=p1;
			p1=(struct Student*)malloc(LEN);
			scanf("%s %s %c%d%s%s",&p1->number,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->address);
			p1->front=p2;
	}
	while(p2!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p2->number,p2->name,p2->sex,p2->age,p2->score,p2->address);
		p2=p2->front;
	}
}
struct student 
{
	char a[20];
	char b[40];
	char c;
	int d;
	float e;
	char f[20];
	struct student*before;
};
int n;
struct student* hh()
{
	struct student*p1,*p2,*head;n=0;
	p1=p2=(struct student*)malloc(LEN);
	scanf("%s ",&p1->a);head=NULL;
	while(strcmp(p1->a,"end"))
	{
		scanf("%s %c %d %f %s ",&p1->b,&p1->c,&p1->d,&p1->e,&p1->f);
		n=n+1;
		if(n==1)
			p1->before=NULL;
		else p1->before=p2;
		p2=p1;
		p1=(struct student*)malloc(LEN);
		scanf("%s ",&p1->a);
	};
	head=p2;
	return(head);
}
void main()
{
	struct student*p;
	p=hh();
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->a,p->b,p->c,p->d,p->e,p->f);
		p=p->before;
	};
}
void main()
{
    struct stu
    {
        char num[100];
        char nam[100];
        char sex;
        int age;
        float sco;
        char add[100];
        struct stu *next;
    };
    int len=1,i;
    struct stu *p1,*p2,*head,*new,*newhead;
    p1=p2=head=(struct stu *) malloc(sizeof(struct stu));
    scanf("%s",p1->num);
    while(strcmp(p1->num,"end")!=0)
    {
        scanf("%s %c%d%f%s",p1->nam,&p1->sex,&p1->age,&p1->sco,p1->add);
        p1=(struct stu *) malloc(sizeof(struct stu));
        scanf("%s",p1->num);
        if(strcmp(p1->num,"end")==0) p2->next=NULL;
        else
        {
            p2->next=p1;
            p2=p1;
            len++;
        }
    }
    p1=head;
    for(i=0;i<len;i++)
    {
        p2=p1=head;
        while(p1->next!=NULL)
        {
            p2=p1;
            p1=p1->next;
        }
        if(i==0)
            newhead=new=p1;
        else
            new=new->next=p1;
        p2->next=NULL;
    }
    p1=newhead;
    for(i=0;i<len;i++)
    {
        printf("%s %s %c %d %g %s\n",p1->num,p1->nam,p1->sex,p1->age,p1->sco,p1->add);
        p1=p1->next;
    }
}
struct Node
{
 char Info[200];
 struct Node *Next;
};
 
int Insert(struct Node *Head)
{
    struct Node *Tmp;
    Tmp=(struct Node *)malloc(sizeof(struct Node));
    gets(Tmp->Info);
    if(strcmp(Tmp->Info,"end")==0)
       {
         free(Tmp);
         return 0;
       }
    else
        {
          Tmp->Next=Head->Next;
          Head->Next=Tmp;
          return 1;
        }
}

int main()
{
    struct Node *Head,*Tmp;
    Head=(struct Node *)malloc(sizeof(struct Node));
    Head->Next=NULL;
    while(Insert(Head));
    Tmp=Head;
    while(Tmp->Next!=NULL)
         {
          Tmp=Tmp->Next;
          printf("%s\n",Tmp->Info);
         }
   return 1;
}
struct student
{
	char num[200],name[80],sex[20],age[30],score[30],add[200];
	struct student *next;
};
 struct student *creat()
{struct student *head,*p1,*p2;
  p1=(struct student*)malloc(LEN);
  scanf("%s",p1->num);
  p1->next=0;
  while(strcmp(p1->num,"end")!=0)
  {   p2=p1;
	  scanf("%s%s%s%s%s\n",p1->name,p1->sex,p1->age,p1->score,p1->add);
	  p1=(struct student*)malloc(LEN);
	  p1->next=p2;
	  scanf("%s",p1->num);
  }
  head=p2;
  return head;
}
void print (struct student* head)
  {   struct student *p;
      for(p=head;p!=0;p=p->next)
	  { printf("%s %s %s %s %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
      }
  }
 
int main()
  {  struct student* head;
      head=creat();
      print(head);
	  return 7;
  }
struct sa
{
	char a[500];
	struct sa *next;
};
int n;
struct sa *kao(void)
{
	struct sa *head;
	struct sa *p1,*p2;
	n=0;
    head=NULL;
	p1=p2=(struct sa *)malloc(len);
	gets(p1->a);
	head=p1;
    for(;;)
	{
       n++;
	   if(n==1)
		   p1->next=NULL;
	   else
	   {
		   p2=p1;
           p1=(struct sa *)malloc(len);
		   p1->next=p2;
		   gets(p1->a);
	   }
	   if(strcmp(p1->a,"end")==0)
		   break;
	}
	head=p2;
	return (head);
}
int main()
{
	struct sa *p;
	p=kao();
	for(;p!=NULL;)
	{
		printf("%s\n",p->a);
		p=p->next;
	}
	return 0;
}
struct	STUDENT
{
 char student[100];
	struct STUDENT*	former;
};
int main()
{
	struct STUDENT*	p1 = (struct STUDENT*) malloc(sizeof(struct STUDENT));
	struct STUDENT*	p2;
	p1->former = NULL;
	for (gets(p1->student);p1->student[0]!='e'; gets(p1->student))
	{
		p2 = p1;
		p1 = (struct STUDENT*) malloc(sizeof(struct STUDENT));
		p1->former = p2;
	}
	for (p1=p1->former; p1!=NULL; p1=p1->former)
	{
		printf("%s\n", p1->student);
	}
	return 0;
}
struct student 
{
       char num[100];
       struct student *next;
};
main()
{
      int n;
      struct student *head;
      struct student *p1,*p2;
      n=0;
      p1=p2=(struct student*)malloc(LEN);
      gets(p1->num);
     
      while(p1->num[0]!='e')
      {
      n=n+1;
      if(n==1) p1->next=NULL;
      else p1->next=p2;
      p2=p1;
      p1=(struct student*)malloc(LEN);
      gets(p1->num);
      }
      head=p2;
      do
      {
              printf("%s\n",head->num);
              head=head->next;
      }while(head!=NULL);

}
struct student 
{
	char num[10];
	char name[30];
	char gender;
	int age;
	char score[10];
	char address[30];
	struct student *before;
};

void main ()
{
	struct student stu[1000], *tail, *p;
	int i=0,j;

	
	while (scanf ("%s %s %c %d %s %s",&stu[i].num, &stu[i].name, 
			&stu[i].gender, &stu[i].age, &stu[i].score, &stu[i].address)!=EOF)
			i++;
//	for (i=0;stu[i].num[0]!='e';i++)
//	{
//		scanf ("%s %s %c %d %d %s",stu[i].num, stu[i].name, 
//			&stu[i].gender, &stu[i].age, &stu[i].score, stu[i].address);
//	}
	tail=&stu[i-1];
	for (j=i-1;j>=0;j--)
		stu[j].before=&stu[j-1];
	stu[0].before=0;
	p=tail->before;
	do 
	{
		
			printf ("%s %s %c %d %s %s\n",p->num, p->name, p->gender,
				p->age, p->score, p->address);


	p=p->before;
	}
	while (p!=0);	
}
struct student
{char c[300];
 struct student *next;
};
int n;
struct student * create()
{struct student *head,*p1,*p2;
 n=0;
 p1=p2=head=(struct student*)malloc(Len);
 gets(head->c);
 head->next=0;
 while (strcmp("end",p1->c)!=0)
 {head=p1;
  p1=(struct student*)malloc(Len);
  p1->next=head;
  gets(p1->c);
 }
 return head;
}
int main()
{   struct student *start;
	start=(struct student*)create();
	do 
	{printf("%s\n",start->c);
	 start=start->next;
	}while (start->next!=0);
	printf("%s\n",start->c);
	return 7;
}
struct stu
{
	char num[20],name[20],add[30],sex;
	int age;
	float score;
	struct stu *next;
}
main()
{
	struct stu *p1,*p2;
	p1=(struct stu*)malloc(len);
	p1->next=NULL;
	while(1)
	{
		scanf("%s",p1->num);
		if(!strcmp(p1->num,"end")) break;
		scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->add);
		p2=(struct stu*)malloc(len);
		p2->next=p1;
		p1=p2;
	}
	p1=p1->next;
	while(p1)
	{
		printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->next;
	}

	
}
struct student
{
	char num[1000];
  	struct student *next;
};
int n;
struct student * creat (void )
{
	struct student * head;
	struct student *p1,*p2;
	char a[4]={"end"};
	n=0;
	p1=p2= (struct student *)malloc(LEN);
	gets( p1->num );
	head = NULL;
	while (strcmp(p1->num,a)!=0)
	{
		n=n+1;
		if (n==1) head =p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		 gets( p1->num );
	}
	p2->next =NULL;
	return head;
}
void print(struct student *head)
{
	struct student *p;
	p=head;
	if (head !=NULL)
		do
		{
			printf("%s\n",p->num );
			p=p->next;
		}
		while (p!=NULL);
}
struct student * sort (struct student *head)
{
     struct student *p1,*p2,*p3;

	 p1=head;
	 p2=p1->next;
	 p1->next=NULL;
	 while( p2->next!=NULL )
	 {
	   head=p2;
	   p3=p2->next;
	   p2->next=p1;
	   p1=p2;
       p2=p3;
	 }
	 head=p2;
	   p2->next=p1;
	   return head;
	 
}
void main()
{
	struct student *head ;
	head=creat();
	head=sort(head);
	print(head);
}
struct student
{
       char what[100];
       struct student *last;
};
void print(struct student *p)
{
     printf("%s\n",p->what);
     if(p->last!=NULL)print(p->last);
}
main()
{
      struct student stu,*head,*tail,*p1,*p2;
      tail=(struct student*)malloc(LEN);
      tail->last=NULL;
      gets(tail->what);
      p1=tail;
      while(strcmp(p1->what,"end")!=0)
      {
                                      p2=(struct student*)malloc(LEN);
                                      p2->last=p1;
                                      gets(p2->what);
                                      p1=p2;
      }
      head=p1->last;
      print(head);
}
struct student
{
	char ID[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char address[20];
	struct student*next;
};
struct student*creat()
{
	struct student*head,*p1,*p2;
	p1=(struct student*)malloc(LEN); 
    scanf("%s %s %c %d %s %s",p1->ID,p1->name,&p1->sex,&p1->age,p1->score,p1->address);
	p1->next=NULL;
	head=p1;
	p2=p1;
	do
	{
		p1=(struct student*)malloc(LEN); 
		scanf("%s",p1->ID);
	    if(strcmp("end",p1->ID)==0)
		{
			break;
		}
		else
		{
            scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
			p1->next=NULL;
		    p2->next=p1;
		    p2=p1;
		}
	}while(1);
	return(head);
}
void print(struct student*head)
{
	struct student*p,*ppr;
	while(head->next!=NULL)
	{
		ppr=head;
		p=head->next;
		while(p->next!=NULL)
		{
			ppr=p;
			p=p->next;
		}
		printf("%s %s %c %d %s %s\n",p->ID,p->name,p->sex,p->age,p->score,p->address);
		ppr->next=NULL;
	}
	printf("%s %s %c %d %s %s\n",head->ID,head->name,head->sex,head->age,head->score,head->address);
}
int main()
{
	struct student*head;
	head=creat();
	print(head);
}
struct student
{char num[20];
char name[20];
char sex;
int age;
float score;
char address[20];
struct student *next;
};

void main()
{
	struct student *p1,*p2,*head,*p;
	p1=p2=(struct student *) malloc(LEN);
	scanf("%s",p1->num);
	p1->next=NULL;
	while(p1->num[0]!='e')
	{
		scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->address);
		p1=(struct student *) malloc(LEN);
		p1->next=p2;
		p2=p1;
		scanf("%s",p1->num);
	}
	p=head=p2->next;
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
		p=p->next;
	}
}
struct stu{
	char info[50];
	struct stu *next;
};

int main(int argc, char* argv[])
{
	struct stu *head,*p1,*p2;
	p2=NULL;
	while(1){
		p1=(struct stu*)malloc(LEN);
		gets(p1->info);
		if(strcmp(p1->info,"end")==0){
			break;
		}
		p1->next=p2;
		p2=p1;
	}
	head=p2;
	p1=head;
	while(1){
		printf("%s\n",p1->info);
		if(p1->next==NULL){
			break;
		}
		p1=p1->next;
		free(p2);
		p2=p1;
	}
	return 0;
}
struct student
{
	char id[1000];
	
    struct student *pre,*next;
};
void main()
{
	struct student *p1,*p2,*head1,*head2;
	int n=0;
	char temp[1000]; 
	p1=p2=NULL;
	while(gets(temp),strcmp(temp,"end")!=0)
	{
		n=n+1;
		p1=(struct student *)malloc(sizeof(struct student));
		p1->pre=NULL;
		p1->next=NULL;
		head1=NULL;
		strcpy(p1->id,temp);
		
		if(n==1)head1=p1;else {p2->next=p1;p1->pre=p2;}
		p2=p1;
	}
	
	head2=p2;
	while(p2!=NULL)
	{
		printf("%s\n",p2->id);
		p2=p2->pre;
	}
}
struct student
{
 char num[50]; /*??*/
 char name[50];/*??*/
 char sex;/*??*/
 int year;/*??*/
 char score[50]; /*??*/
 char add[50];/*??*/
 struct student *next; /*?????????*/
};

int n; /*????*/

struct student *Create()
{
 struct student *head; /*???*/
 struct student *p1=NULL; /*p1???????????*/
 struct student *p2=NULL; /*p2??????????????*/

 n = 0; /*???????????0????*/
 p1 = (struct student *)malloc(LEN); /*???????*/
 p2 = p1; /*??????????p2??????????????*/
 if (p1 == NULL) /*???????*/
 {
  printf("\nCann't create it, try it again in a moment!\n");
  return NULL;
 }
 else /*??????*/
 {
  head = NULL; /*??head??NULL*/

   scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->year,p1->score,p1->add);
   /*????*/
 }
 int j=0;
 for(;;j++)
 {
  n += 1; /*??????1?*/

  if (n==1) /*???????1????????head*/
  {
   p1->next = NULL;

 head=p2; 
  }
  else
  {
   p1->next = p2; /*???????????????*/
  }

  p2 = p1; /*?p1????p2?????p1??????*/ 
  
  p1 = (struct student *)malloc(LEN);
  scanf("%s",p1->num);
  if(strcmp(p1->num,"end")==0) 
		{
			head=p2;
			break;/*???????????*/
		}
  scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->year,p1->score,p1->add);
 }
 
  head=p2; /*????????????head*/
 
 free(p1); /*??p1*/
 p1 = NULL; /*????????????????NULL,?????"???"???????????*/
 return head; /*??????????*/
}


void Print(struct student *head)
{
 struct student *p;

 
 p = head;
 if(head != NULL) /*??????????????????*/
 {
  
  do 
  { 
   printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->year,p->score,p->add);
   p = p->next; /*???????*/
  }
  while (p != NULL);
 }
}

int main()
{
  struct student *head;
head = Create(); 
 Print(head);
	return 0;

}
struct student
{
		char num[20];
		char name[20];
		char sex;
		int age;
		char score[10];
		char add[20];
		struct student *next;
};
int n=0;
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	p1=p2=(struct student *)malloc(LEN);
	head=NULL;
	scanf("%s",p1->num);
	if(p1->num[0]=='e')
		return(head);
	scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
	p1->next=NULL;
	while(p1->num[0]!='e')
	{
		n=n+1;
		head=p1;
		if(n>1)
		{
			p1->next=p2;
			p2=p1;
		}
		p1=(struct student *)malloc(LEN);
		scanf("%s",p1->num);
		if(p1->num[0]=='e')
			break;
		scanf("%s %c %d %s %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)
		do
		{
			printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
			p=p->next;
		}while(p!=NULL);
}
void main()
{
	struct student *head;
	head=creat();
	print(head);
}
struct student
	{
		char num[10];
		char name[30];
		char sex;
		int age;
		char score[10];
		char address[20];
		struct student *next;
	};
struct student *creat()
{
	struct student *head,*p;
	head=(struct student*)malloc(Len);
	scanf("%s",head->num);
		if(strcmp(head->num,"end")==0) head=NULL;
			else scanf("%s %c %d %s %s",head->name,&head->sex,&head->age,head->score,head->address);
	head->next=NULL;
	while(1)
	{
		p=head;
		head=(struct student*)malloc(Len);
		scanf("%s",head->num);
			if(strcmp(head->num,"end")==0) {head=p;break;}
			else scanf("%s %c %d %s %s",head->name,&head->sex,&head->age,head->score,head->address);
		head->next=p;
	}
	return head;
}
void print(struct student *head)
{struct student *q;
q=head;
while(q){printf("%s %s %c %d %s %s\n",q->num,q->name,q->sex,q->age,q->score,q->address);
q=q->next;}
}
void main()
{
	print(creat());
}
struct student
{
	char num[100];
	struct student *next;
};

main()
{
	int n,i;
	struct student *head,*p1,*p2,*p;
	n=0;p1=p2=(struct student*) malloc(LEN);
	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(LEN);
		gets(p1->num);
	}
	p2->next=NULL;
	for(i=0;i<n;i++)
	{
		p=head;
		while(p->next!=NULL)
		{
			p1=p;
			p=p->next;
		}
		printf("%s\n",p->num);
		p1->next=NULL;
	}
}