semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	struct stu
	{
		char num[20];
		char name[20];
		char sex;
		int age;
		float score;
		char addr[20];
		struct stu*next;
	}*p1,*p2;
	p1=malloc(sizeof(struct stu));
	scanf("%s",p1->num);
	if(*p1->num!='e')
	{
		scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->addr);
		p1->next=0;
		for(;;)
		{
			p2=p1;
			p1=malloc(sizeof(struct stu));
			scanf("%s",p1->num);
			if(*p1->num=='e')break;
			scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->addr);
			p1->next=p2;
		}
		p1=p2;
		for(;p1;p1=p1->next)printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->addr);
	}
}
struct student
{
	char a[1000];
	struct student *next;
};
void main()
{
	struct student *head,*p1,*p2;
	p1=head=(struct student*)malloc(LEN);
//	scanf("%s %s %c %d %d %s",p1->num,p1->name,&p1->sex,&p1->age,
//			&p1->score,p1->addr);
	p1->next=NULL;
	gets(p1->a);
	while(strcmp(p1->a,"end"))
	{
		p2=(struct student*)malloc(LEN);
		p2->next=p1;
	    p1=p2;
		gets(p1->a);
	}
	while(p1->next!=NULL)
	{
		p1=p1->next;
		printf("%s\n",p1->a);
	}
}
struct a {
char id[150];

struct a *pre;
};


struct a *creat(){

struct a *head, *p1, *p2;

p1=(struct a*)malloc(l);
gets(p1->id);
p1->pre=NULL;

p2=p1;

while(1){
p1=(struct a*)malloc(l);
gets(p1->id);
if (p1->id[0]=='e'){break;}
p1->pre=p2;
p2=p1;
}
free(p1);
head=p2;
return head;
}

void des(struct a *head){
struct a *p;
while(head){
p=head;
head=head->pre;
free(p);
}
}

int main (){
struct a *head, *p;
head=creat();

p=head;
while(p){
printf("%s\n", p->id);
p=p->pre;
}

des(head);
return 0;
}
void myPrint()
{
	char str[100];
	gets(str);
	if(strcmp(str,"end"))
		myPrint();
	else
		return;
	puts(str);
}

int main()
{
	myPrint();

	return 0;
}
int num=0;
void main()
{
	struct student
	{
		char xh[100];
		char xm[100];
		char xb;
		int nl;
		float df;
		char dz[100];
		struct student *af;
		struct student *bf;
	};
	int i,j,k,m,n;
	struct student *p1,*p2,*p3,*p4,*head;
	p1=p2=(struct student *)malloc(sizeof(struct student));
	scanf("%s %s %c %d %f %s",p1->xh,p1->xm,&p1->xb,&p1->nl,&p1->df,p1->dz);
	p1->bf=0;
	while(strcmp(p2->xh,"end")!=0)
	{
		p1=(struct student *)malloc(sizeof(struct student));
		scanf("%s",p1->xh);
		if(strcmp(p1->xh,"end")==0)
		{
			head=p2;
			p1->bf=p2;
			p2->af=p1;
			p2=p1;
			num++;
			p1->af=0;
			break;
		}
		scanf("%s %c %d %f %s",p1->xm,&p1->xb,&p1->nl,&p1->df,p1->dz);
		p1->bf=p2;
		p2->af=p1;
		p2=p1;
		num++;
	}
	//if(strcmp(p1->xh,"end")==0)p1->af=0;
	//printf("%d",num);
	p1=head;
	//printf("%c",p1->xb);
	for(i=0;i<num;i++)
	{
		printf("%s %s %c %d %g %s\n",p1->xh,p1->xm,p1->xb,p1->nl,p1->df,p1->dz);
		p1=p1->bf;
	}
	
}
struct student
{
	char locate[100];
	struct student *next;
	struct student *last;
};
int n;
char u[100];
struct student *creat(void)
{
struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=(struct student*)malloc(LEN);
gets(p1->locate);
strcpy(u,p1->locate);
head=NULL;
while(strcmp(p1->locate,"end")!=0)
{n=n+1;
if(n==1){head=p1;}
else {p2->next=p1;p1->last=p2;}
p2=p1;
p1=(struct student*)malloc(LEN);
gets(p1->locate);
}
p1->last=p2;
p2->next=NULL;
return(p2);
}
void main()
{   
	struct student *creat(void);
	struct student *p;
	p=creat();
	do
	{printf("%s\n",p->locate);
	p=p->last;
	}while(strcmp(p->locate,u)!=0);
	printf("%s",p->locate);
}
struct stu
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char grade[20];
	char add[20];
	struct stu *p;
};
int main ()
{
	struct stu *p1,*p2;
	p1=(struct stu*)malloc(sizeof(struct stu));
	p1->p=NULL;
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->grade,p1->add);
	while(1)
	{		
		p2=p1;
		p1=(struct stu*)malloc(sizeof(struct stu));
		p1->p=p2;
		scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->grade,p1->add);
		if(p1->num[0]=='e')
			break;
	}
	while(p1->p!=NULL)
	{
		p1=p1->p;
		printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->grade,p1->add);
	}
	return 0;
}
// ???????????????

struct record
{
	char str[100];
};

struct YyxNode
{
	struct record m_rec;
	struct YyxNode *next;
};

struct YyxStack
{
	int n;
	struct YyxNode *top;
};

struct YyxStack *CreateNewStack()
{
	struct YyxStack *newSt;
	if((newSt=(struct YyxStack*)malloc(sizeof(struct YyxStack)))==NULL){
		printf("Error: memory out! (1)\n");
		exit(-1);
	}
	newSt->n = 0;
	newSt->top = NULL;

	return newSt;
}

struct YyxStack *Push(struct YyxStack *st, const struct record *rec)
{
	struct YyxNode *newNode;
	if((newNode=(struct YyxNode*)malloc(sizeof(struct YyxNode)))==NULL){
		printf("Error: memory out! (2)\n");
		exit(-1);
	}
	newNode->m_rec = *rec;
	newNode->next = st->top;
	st->top = newNode;
	st->n ++;

	return st;
}

struct YyxStack *Top(struct YyxStack *st, struct record *rec)
{
	*rec = st->top->m_rec;

	return st;
}

struct YyxStack *Pop(struct YyxStack *st)
{
	struct YyxNode *delNode = st->top;
	if (delNode==NULL)
		return st;
	st->top = delNode->next;
	st->n --;

	free(delNode);

	return st;
}

struct YyxStack *ClearStack(struct YyxStack *st)
{
	while(st->top!=NULL)
		Pop(st);

	return st;
}

int main()
{
	struct YyxStack *mainSt;
	struct record stu;
	mainSt = CreateNewStack();
	gets(stu.str);
	while(strcmp(stu.str, "end")){
		Push(mainSt, &stu);
		gets(stu.str);		
	}
	while(mainSt->n>0){
		Pop(Top(mainSt, &stu));
		puts(stu.str);
	}

//	free(ClearStack(mainSt));

	return 0;
}
struct student
{
	char a[100];
	struct student *next;
	struct student *last;
};
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	p1=(struct student *)malloc(sizeof(struct student));
	gets(p1->a);
	p1->last=NULL;
	int i;
	for(i=1;strcmp(p1->a,"end")!=0;i++)
	{
		if(i==1);
		else {p2->next=p1;p1->last=p2;}
		p2=p1;
		p1=(struct student *)malloc(sizeof(struct student));
		gets(p1->a);
	}
	p2->next=NULL;head=p2;
	return(head);
}
main()
{
	struct student *head,*p;
	head=creat();
	p=head;
	int i;
	for(i=0;p->last!=NULL;i++)
	{
		printf("%s\n",p->a);
		p=p->last;
	}
	printf("%s",p->a);
}
struct student  
{
       char id[10];
       char name[100];
       char sex;
       int age;
       char score[100];
       char adr[100];
       struct student *next;
};
int n=0;
struct student *creat()
{
       struct student *head,*p1,*p2;
       head=NULL;
       p1=p2=(struct student*)malloc(LEN);
       scanf("%s %s %c%d%s%s",&p1->id,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->adr);
       while(p1->id[0]!='e')
       {
         n++;
         if(n==1)
         head=p1;
         else  
         p2->next=p1;
         p2=p1;
         p1=(struct student*)malloc(LEN);
         scanf("%s %s %c%d%s%s",&p1->id,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->adr);
       }
       p2->next=NULL;
       return(head);
}
void print(struct student*head,int m)
{
     struct student*p1;
     p1=head;
     if(head!=NULL)
         do
         {
                   printf("%s %s %c %d %s %s\n",p1->id,p1->name,p1->sex,p1->age,p1->score,p1->adr);
                   p1=p1->next;
         }while(p1!=NULL);
}
struct student *turnback(struct student *head)
{
       struct student *p1,*p2,*news,*p;
      
       int i;
       
       for(i=n;i>=0;i--)
       {p2=p1=head;
       while(p1->next!=NULL)
       {
                            p2=p1;p1=p1->next;
       }
      
                            if(i==n)
                            p=news=p1;
                            
                            else
                            {
                              p=p->next=p1;
                              p2->next=NULL;   
                            }
                            
       }
       return(news);
}

int main()
{
    struct student*head,*newhead;
    head=creat();
    newhead=turnback(head);
    print(newhead,n);
    getchar();
    getchar();
    getchar();
    getchar();
}
struct stu
{
  char num[50];
  char name[50];
  char sex;
  int age;
  float score;
  char add[50];
  struct stu *forward;
};

void main()
{  int n=0;
   struct stu *head,*p1,*p2;head=NULL;
   p1=p2=(struct stu *)malloc(LEN);
   while(1)
   {
	   n++;
   if(n==1){head=p1;head->forward=NULL;}
   else {p1->forward=p2;}
   scanf("%s",p1->num);
      if(strcmp(p1->num,"end")==0)break;

   scanf(" %s",p1->name);
   scanf(" %c",&p1->sex);
   scanf(" %d",&p1->age);
   scanf(" %f",&p1->score);
   scanf(" %s",p1->add);
   p2=p1;
   p1=(struct stu *)malloc(LEN);
   } 
   
   struct stu *p;
   p=p2;
   if(p->forward!=NULL)
   {
     do
	 {
	 printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
	 p=p->forward;
	 }while(p!=NULL);
   
   }

}
struct student
{
    char str[50];
    struct student *next;
};
int n;
struct student *creat()
{
    struct student *head, *temp, *end;
    head = end = temp = (struct student*) malloc(LEN);
    gets(temp->str);
    while (temp->str[0] != 'e')
    {
        temp->next = head;
        head = temp;
        temp = (struct student*) malloc(LEN);
        gets(temp->str);
    }
    end->next = NULL;
    return (head);
}
void print(struct student *head)
{
    struct student *p;
    p = head;
    while (p != NULL)
    {
        puts(p->str);
        p = p->next;
    }
}
void main()
{
    struct student *head;
    head = creat();
    print(head);
}
struct stu
{
	char num[100];
	char name[100];
	char sex[3];
	char age[10];
	char score[10];
	char ad[100];
	struct stu*next;
	struct stu*pre;
};
int main(int argc, char* argv[])
{
	int cal=0,i=0;
	char end[100];
	struct stu*head,*p1,*p2;
	p1=(struct stu*)malloc(len);
	scanf(" %s %s %s %s %s %s",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->ad);
	p1->next=NULL;
	p1->pre=NULL;
	head=p1;
	p2=p1;
	while(1)
	{
		scanf("%s",end);
		if(end[0]=='e')
		{break;}
		p1=(struct stu*)malloc(len);
		strcpy(p1->num,end);
		scanf("%s %s %s %s %s",p1->name,p1->sex,p1->age,p1->score,p1->ad);
		cal++;
		p1->next=NULL;
		p1->pre=p2;
		p2->next=p1;
		p2=p1;
	}
	while(p2)
	{
		printf("%s %s %s %s %s %s\n",p2->num,p2->name,p2->sex,p2->age,p2->score,p2->ad);
		p1=p2;
		p2=p2->pre;
		free(p1);
	}
	return 0;
}
void append()
{
    char str[50];
    gets(str);
    if (str[0] != 'e')
    {
        append();
        puts(str);
    }
}
void main()
{
    append();
}
struct w
{char id[100];
struct w *next;
};
struct w *head,*new,*newhead,*p1,*p2;
 int i,n;

void main()
{
	  n=0;
	head=null;
	p1=p2=(struct w *)malloc(len);
	gets(p1->id);
	while(strcmp(p1->id,"end")!=0)
	{
	n++;
	if(n==1)head=p1;
	else p2->next=p1;
	p2=p1;
	p1=(struct w *)malloc(len);
	gets(p1->id);
	}
	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=new=p1;
	else new=new->next=p1;
	p2->next=null;
	}
	p1=newhead;
	for(i=0;i<n;i++)
	{printf("%s\n",p1->id);
	p1=p1->next;
	}
}
struct student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	float score;
	char add[20];
	struct student * next;
};
struct student * input(void)
{
	struct student *p1,*p2,*head;
	p1=(struct student *)malloc(len);
	p1->next=NULL;
	scanf("%s %s %c %d %f %s",p1->num,p1->name,&p1->sex,&p1->age,&p1->score,p1->add);
	do
	{
		p2=(struct student *)malloc(len);
		scanf("%s %s %c %d %f %s",p2->num,p2->name,&p2->sex,&p2->age,&p2->score,p2->add);
		p2->next=p1;
		p1=p2;
	}while(strcmp(p2->num,"end")!=0);
	head=p2->next;
	return(head);
}
void print(struct student*head)
{
	struct student *p;
	p=head;
	do
	{
		printf("%s %s %c %d %g %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=input();
	print(head);
}
struct shuju
{
    char str[100];
    struct shuju * next;
};

struct shuju *create()
{
    
    struct shuju *head,*p1,*p2;
    p1=(struct shuju* )malloc(len);
    gets(p1->str);
    p1->next=NULL;
    while (1)
    { 

    	p2=p1;
        p1=(struct shuju* )malloc(len); 
        gets(p1->str);
        if(strcmp(p1->str,"end")==0) {free(p1);break;}
        p1->next=p2;
    }
    head=p2;
    return (head);
}

void print(struct shuju* head)
{

    struct shuju* p;
    p=head;
    while (p->next!=NULL)
    {
        puts(p->str);
       p=p->next;}
    puts(p->str);
}

void main()
{
    
    
    struct shuju *p;
    p=create();
    print(p);
}
struct node
{
	struct node *back;
	char num[20];
	char name[20];
	char gender;
	int age;
	char score[10];
	char address[20];
	struct node *next;
};
void main()
{
	char end[]="end";
	char t[20];
	struct node *p,*head;
	p=(struct node *)malloc(sizeof(struct node));
	head=p;
	head->back=NULL;
	scanf("%s %s %c %d %s %s",p->num,p->name,&p->gender,&p->age,p->score,p->address);
	scanf("%s",t);
	while(strcmp(t,end)!=0)
	{
		p->next=(struct node *)malloc(sizeof(struct node));
		p->next->back=p;
		p=p->next;
		strcpy(p->num,t);
		scanf("%s %c %d %s %s",p->name,&p->gender,&p->age,p->score,p->address);
		scanf("%s",t);
	}
	do
	{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->gender,p->age,p->score,p->address);
		p=p->back;
	}while(p!=NULL);
}
struct s
{
      char a[100];
      char b[100];
      char c;
      int d;
      char e[100];
      char f[100];
      }k[1000];
int n;
int main(int argc, char *argv[])
{ int i;
    
  for(i=0;;i++)
  {
     scanf("%s",k[i].a);
     if(strcmp(k[i].a,"end")==0)
     break;
     scanf(" %s %c %d %s %s",k[i].b,&k[i].c,&k[i].d,k[i].e,k[i].f);
  }
  for(i=i-1;i>=0;i--)
  printf("%s %s %c %d %s %s\n",k[i].a,k[i].b,k[i].c,k[i].d,k[i].e,k[i].f);
  return 0;
}
struct student
{char num[1000];
struct student *next;
};
void main()
{struct student *head,*p1,*p,*p2,*end;
int n=0;
p=p1=p2=(struct student*)malloc(LEN);
gets(p1->num);
head=NULL;
while(strcmp(p1->num,"end")!=0)
 {n=n+1;
  head=p1;
  if(n==1) p1->next=NULL;
  else p1->next=p2;
  p2=p1;
  p1=(struct student*)malloc(LEN);
  gets(p1->num);
}
p=head;
if (head != NULL)
{do
{puts(p->num);
p=p->next;}
while(p != NULL);}	
}
struct stu
{
   char xinxi[100];
   struct stu *down;
};
int n=0;

struct stu * creat()
{
    struct stu *top=NULL;
    struct stu *p1=NULL,*p2=NULL;
    p1=p2=(struct stu *)malloc(LEN);
   gets(p1->xinxi);
    while(p1->xinxi[0]!='e')
 { 
  n++;
  if(n==1)
   p1->down=NULL;
  else  
   p1->down=p2;
  top=p1;
  p2=p1;
  p1=(struct stu *)malloc(LEN);
  gets(p1->xinxi);
 }
 return(top);
}
void main()
{
 struct stu *top,*p;
 top=creat();
 p=top;
    while(n!=0)
 {n--;
 puts(p->xinxi);
 p=p->down;
 }
}
struct student
{
	
char num[20];
	
char name[100];
	
char sex;
	
int age;
	
char score[10];
	
char address[20];
	
struct student *next;
};
struct student *print()
{
	
struct student *head=NULL,*node;
	
do
	
{
	
	
node=(struct student*)malloc(sizeof(struct student));
	
	
scanf("%s",node->num);
	
	
if(strcmp(node->num,"end")==0)
	
	
	
break;
	
	
else
	
	
{

	
	
scanf("%s %c %d %s %s",node->name,&node->sex,&node->age,node->score,node->address);

	
	
node->next=head;
	
	
head=node;
	
	
}
	

	
}
	
while(1);

	
return head;
}
void main()
{
	
struct student *p;
	
p=print();
	
do
	
{
	
	
printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
	
	
p=p->next;
	
}
	
while(p->next!=NULL);
	
printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
}
int main()
{
	struct student
	{
		char s[500];
		struct student *next;
	}stu[2000],stup[2000];
	int i=0,j;
	struct student *p1,*p2,*head;
	p1=p2=(struct student *)malloc(LEN);
	head=NULL;
	gets(p1->s);
	while((*(p1->s)+0)!='e')
	{
		stu[i]=*p1;
		if(++i==1) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		gets(p1->s);
	}
	p2->next=NULL;
	for(j=0;j<i;j++) stup[j]=stu[i-1-j];
	for(j=0;j<i;j++) printf("%s\n",stup[j].s);
	return 0;
}
struct stu
{char c[100];
 struct stu *previous;
};
int n;
struct stu *creat(void)
{
	struct stu *p,*q;
	n=0;
	p=q=(struct stu *)malloc(Len);
	gets(p->c);
	for(;strcmp(p->c,"end")!=0;)
	{
		n++;
		if(n==1) p->previous=Null;
		else 
		{
			p=(struct stu *)malloc(Len);
			p->previous=q;
			q=p;
			gets(p->c);
		}
	}
	return(p);
}
void main()
{
	struct stu *p;
	p=creat();
	p=p->previous;
	for(;p!=Null;)
	{
		printf("%s\n",p->c);
		p=p->previous ;

	}
}
struct Info
{
	char num[10];
	char name[20];
	char sex;
	int age;
	char score[10];
	char address[20];
	struct Info* next;
	struct Info* former;
};
int main()
{
	struct Info *head,*p1,*p2,*p,*tail;
	head=(struct Info*)malloc(sizeof(struct Info));
	p1=head;
	p2=head;
	char temp[10];
	scanf("%s %s %c %d %s %s",p2->num,p2->name,&p2->sex,&p2->age,p2->score,p2->address);
	head->former=NULL;
	head->next=NULL;
	p2=(struct Info*)malloc(sizeof(struct Info));
	while(1)
	{
		scanf("%s",temp);
		if (strcmp(temp,"end")!=0)
		{
			strcpy(p2->num,temp);
			scanf("%s %c %d %s %s",p2->name,&p2->sex,&p2->age,p2->score,p2->address);
			p2->former=p1;
			p2->next=NULL;
			p1->next=p2;
			p1=p2;
			p2=(struct Info*)malloc(sizeof(struct Info));
		}
		else
		{
				tail=p1;
				break;
		}
	}
	p=tail;
	do
	{
		if((p->score-(int)p->score)!=0)
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
		else
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
		p=p->former;
	}
	while(p!=NULL);
	return 0;}
struct student
	{ char num[20];
	char name[20];
	char sex;
	int age;
	double score;
	char add[100];
	struct student*next;
	}*head,*p1;
void main()
{
	int n=0;
	p1=(struct student*)malloc(LEN);
	scanf("%s",p1->num);
	while(p1->num[0]!='e')
	{
scanf("%s %c%d%lf%s",p1->name,&p1->sex,&p1->age,&p1->score,p1->add);
		n++;
		if(n==1)p1->next=NULL;
		else p1->next=head;
head=p1;
		p1=(struct student*)malloc(LEN);
		scanf("%s",p1->num);
	}
	p1=head;
	do
	{
		printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->next;
	}
while(p1!=NULL);
}
struct stu_imformation 
{ 
char num[16]; 
char name[20]; 
char sex; 
int age; 
char score[10]; 
char site[20]; 
struct stu_imformation *next; 
}; 
void main() 
{ 
struct stu_imformation *head,*p1,*p2; 
head=(struct stu_imformation *)malloc(LEN); 
scanf("%s %s %c %d %s %s",head->num,head->name,&head->sex,&head->age,head->score,head->site); 
p2=head; 
head->next=NULL; 
p1=(struct stu_imformation *)malloc(LEN);
scanf("%s",p1->num);
while(strcmp(p1->num,"end"))  
{ 
scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->site); 
p1->next=p2; 
head=p1; 
p2=p1; 
p1=(struct stu_imformation *)malloc(LEN); 
scanf("%s",p1->num);
} 
p1=head; 
while(p1!=NULL)
{ 
printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->site); 
p1=p1->next; 
} 
}
struct student
{
	char num[15];
	char name[20];
	char sex;
	int age;
	char score[10];
	char add[30];
	struct student *next;
};
int main()
{
	int n,i;
	struct student *head,*p1,*p2;
	n=0;
	p1=p2=(struct student *)malloc(LEN);
	p1->next=NULL;
	scanf("%s ",p1->num);
	while(strcmp(p1->num,"end")!=0)
	{
		n++;
		scanf("%s %c %d %s %s\n",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		p2=(struct student *)malloc(LEN);
		p2->next=p1;
		p1=p2;
		scanf("%s ",p1->num);
	}
	head=p1->next;
	p1=p2=head;
	for(i=0;i<n;i++)
	{
		printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p2->next;
		p2=p1;
	}
}
struct student
{
	char stuID[20];
	char name[20];
	char sex;
	int age;
	char score[10];
	char add[20];
	struct student*next;
};
int main()
{
	struct student *p,*a;
	char str[10]={"end"};
	p=(struct student*)malloc(sizeof(struct student));
	scanf("%s",p->stuID);
	p->next=NULL;
	while(strcmp(p->stuID,str)!=0)
	{
		scanf("%s %c %d %s %s",p->name,&(p->sex),&(p->age),p->score,p->add);
		a=p;
		p=(struct student*)malloc(sizeof(struct student));
		p->next=a;
		scanf("%s",p->stuID);
	}
	while(p->next!=NULL)
	{
		p=p->next;
		printf("%s %s %c %d %s %s\n",p->stuID,p->name,p->sex,p->age,p->score,p->add);
	}
	return 0;
}
struct stu
{
	char num[20];
	char name[20];
	char s;
	int age;
	char point[10];
	char adr[50];
	struct stu *p;
};
void main()
{
	struct stu *stu1=NULL;
	int n=sizeof(struct stu);
	stu1=(struct stu *) malloc(n);
	struct stu *head=NULL,*curent=NULL;
	stu1->p=NULL;
	while(scanf("%s",stu1->num))
	{
		if((strcmp(stu1->num,"end"))==0)
			break;
		scanf("%s %c %d %s %s",stu1->name,&stu1->s,&stu1->age,&stu1->point,stu1->adr);
		stu1->p=curent;
		curent=stu1;
		stu1=(struct stu*) malloc(n);
	}
	while(curent!=NULL)
	{
		printf("%s %s %c %d %s %s\n",curent->num,curent->name,curent->s,curent->age,curent->point,curent->adr);
		stu1=curent;
		curent=curent->p;
		free(stu1);
	}
}
struct student
{
	int age;
	float score;
	char name[100],sex,add[20],num[20];
	struct student *p;
};
void main()
{
	struct student *p1,*head;
	p1=head=(struct student *) malloc(LEN);
	p1->p=NULL;
	scanf("%s %s %c %d %f %s",p1->num,p1->name,&p1->sex,&p1->age,&p1->score,p1->add);
	while (1)
	{
		p1=(struct student *) malloc(LEN);
		scanf("%s",p1->num);
		if (p1->num[0]!='e')
		{
		scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->add);
		p1->p=head;
		head=p1;
		}
		else break;
	}
	p1=head;
	while (p1!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->p;
	}
}
struct student
{
	char str[1000];
	struct student *next;
};
int main()
{
	struct student *p,*pnew,*head,*p1;
	pnew=(struct student *)malloc(sizeof(struct student));
	gets(pnew->str);
	pnew->next=NULL;
	if(strcmp(pnew->str,"end")==0)
	{
		free(pnew);
		head=NULL;
	}
	else
	{
		head=pnew;
		p=pnew;
	while(1)
	{
		pnew=(struct student *)malloc(sizeof(struct student));
		gets(pnew->str);
		pnew->next=NULL;
		if(strcmp(pnew->str,"end")==0)
		{
			free(pnew);
			break;
		}
		else
		{
			head=pnew;
			pnew->next=p;
			p=pnew;
		}
	}
	}
	p1=head;
	while(p1)
	{
		printf("%s\n",p1->str);
		p1=p1->next;
	}
	return 0;
}
struct student//?? ?? ?? ?? ?? ??
{
	char num[12];
	char name[20];
	char sex;
	int age;
	float grade;
	char add[12];
	struct student *next;
};
int n=1;
struct student *build(void)	//????
{
	struct student *pn, *pt;
	pn=(struct student*)malloc(sizeof(struct student));
	scanf("%s",pn->num);
	pn->next=NULL;
	while(pn->num[0]!='e')
	{
		scanf(" %s %c %d %f %s",&pn->name,&pn->sex,&pn->age,&pn->grade,&pn->add);
		pt=pn;
		pn=(struct student*)malloc(sizeof(struct student));
		pn->next=pt;
		scanf("%s",pn->num);
	}
	return (pt);
}
void main()
{
	struct student *p;
	p=build();
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->grade,p->add);
		p=p->next;
	}
}
struct student{char xh[20];char name[50];char sex;int age;char gra[10];char adds[50];struct student *next;};

void main()
{

	struct student *pa,*pb;
	int i;
	pa=pb=(struct student*)malloc(l);
	for(i=0; ;i++)
	{   scanf("%s",pa->xh);
	    if(pa->xh[0]=='e') break;
		scanf("%s %c %d %s %s",pa->name,&pa->sex,&pa->age,pa->gra,pa->adds);
		if(i==0) {pa->next=NULL;}
	    else pa->next=pb;
	    pb=pa;
	    pa=(struct student*)malloc(l);
	}
	
	while(pb!=NULL) {printf("%s %s %c %d %s %s\n",pb->xh,pb->name,pb->sex,pb->age,pb->gra,pb->adds);pb=pb->next;}
}
struct student
{
	char num[10];
	char name[20];
	char sex;
	int age;
	char score[10];
	char add[20];
	struct student *next;
};
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	p1=p2=(struct student *)malloc(LEN);
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->add);
	head=p1;
loop:
	p1=(struct student *)malloc(LEN);
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->add);
	if(strcmp(p1->num,"end")!=0)
	{
		p2->next=p1;
		p2=p1;
		goto loop;
	}
	else p2->next=NULL;
	return(head);
}
struct student *reverse(struct student *head)
{
	struct student *nowp,*prep,*nextp;
	prep=NULL;
	nowp=head;
	while(nowp!=NULL)
	{
		nextp=nowp->next;
		nowp->next=prep;
		prep=nowp;
		nowp=nextp;
	}
	return(prep);
}
int main()
{
	struct student *head,*head1;
	head=creat();
	head1=reverse(head);
	struct student *pt1;
	pt1=head1;
	while(pt1!=NULL)
	{
		printf("%s %s %c %d %s %s\n",pt1->num,pt1->name,pt1->sex,pt1->age,pt1->score,pt1->add);
		pt1=pt1->next;
	}
return 0;
}