semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct student //?????
{
	char id[10];
	char name[20];
	char gender;
	int age;
	char score[10];
	char address[20];
	struct student *next, *up;//next?????????,up???????????????????
};
int main()
{
		struct student *head, *tail, *p, *r,*q;
	p=r=head=(struct student *)malloc(len);//head???????
	p->up=NULL;//??????up????null??????????up??????????????
	do
	{
		scanf("%s",p->id);
		if(strcmp(p->id,"end")!=0)//???????end??????????
		{
			scanf("%s %c %d %s %s",p->name,&p->gender,&p->age,p->score,p->address);
			p->next=r=(struct student *)malloc(len);//??????next???????up???????
			r->up=p;
			p=r;
		}
		else
		{
			p->next=NULL;//??????
			tail=p->up;//?tail????????????????up???????????
			break;
		}
	}while(1);
	q=tail;
	do
	{
		printf("%s %s %c %d %s %s\n",q->id,q->name,q->gender,q->age,q->score,q->address);//?up?????
		q=q->up;
	}while(q!=NULL);
		return 0;
}
struct student{
    char num[20];
	char name[20];
	char sex;
	int old;
	float score;
	char add[15];
	struct student *next;
};

int main()
{
	struct student *p1,*p2;
	p1=(struct student *)malloc(len);
	p1->next=NULL;
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0){
		scanf("%s %c %d %f %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);
	}
	return 0;
}
struct node;
struct node
{
    char id[len];
    char name[len];
    char sexual[len];
    char age[len];
    char score[len];
    char addr[len];
    struct node* next;
    struct node* pre;
};
char end[len]="end";
int main(){

    struct node* p;
    p=(struct node*)malloc(sizeof(struct node));
    p->pre=NULL;
    while(1){
        scanf("%s",p->id);              
        if(strcmp(p->id,end)==0)              
            break;
        scanf("%s%s%s%s%s",p->name,p->sexual,p->age,p->score,p->addr);  
        p->next = (struct node*) malloc(sizeof(struct node));    
        p->next->pre = p;           
        p=p->next;                                 
    }
    p=p->pre;                 
    free(p->next);              
    while(p!=NULL){                
        printf("%s %s %s %s %s %s\n",p->id,p->name,p->sexual,p->age,p->score,p->addr);   
        p=p->pre;                 
        if(p!=NULL)                 
            free(p->next);  
    }
    return 0;
}
struct student
{
	char num[30];//???????end??strcpy??
	char name[30];
	char sex;
	int age;
	char score[30];//???????????
         char add[30];
	struct student *next;
}*p1,*p2;//???????????
int n;//????

struct student *creat(void)     //????
{
	struct student *head=NULL;
	char temp[30]={"end"};
	n=0;
         p1=p2=(struct student*)malloc(LEN);// ?????
	scanf("%s",p1->num);

	while(strcmp(p1->num,temp)!=0)//?????end???
	
	{
		scanf(" %s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		n=n+1;
		if(n==1)
			head=p1;//????
		else
		
			p2->next=p1;
			p2=p1;
		
		p1=(struct student*)malloc(LEN);// ?????
        scanf("%s",p1->num);//????????while??
		
	}
	p2->next=NULL;
    return(head);
}

struct student*change(struct student *head)//????
{
	struct student *head1,*head2=NULL;
	do{
         p2=NULL;
		 p1=head;
		 while(p1->next!=NULL)//?p1????
		 {
			 p2=p1;
			 p1=p1->next;
		 }
		 if(head2==NULL)
		 {
			 head2=p1;//?????
			 head1=head2->next=p2;
		 }
		 head1=head1->next=p2;//????????
		 p2->next=NULL;
	}while(head->next!=NULL);
	 return(head2);
}
void print(struct student *head)//??
{
   struct student *p1;
   p1=head;
   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;
   }
   printf("\n");
}

int main()
{
	struct student *head;
	head=creat();
	head=change(head);
	print(head);
	return 0;
}
struct student
{
	char _no[9];
	char name[20];
	char sex[1];
	int age;
	float score;
	char add[20];
	struct student *next;
};
int n;
void main()
{
	int i;
	struct student *p1;
	struct student *p2;
	struct student *head;
	n=0;
	p1=p2=(struct student*)malloc(LEN);
	head=NULL;
	for(n=0;;)
	{
		n=n+1;
		p1=(struct student*)malloc(LEN);
		if(n==1)
		{
			p2->next=NULL;
		}
		{
			scanf("%s",p1->_no);
			if(p1->_no[0]!='e')
			{
				scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->add);
				p1->next=p2;
				p2=p1;
			}
			else
			{
				head=p2;
				break;
			}
		}
	}
	p1=head;
	for(i=0;p1->next!=NULL;i++)
	{
		printf("%s %s %s %d %g %s\n",p1->_no,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->next;
	}
}
struct stu
{
	char a[100];
	struct stu * next;
};
struct stu * create()
{
	struct stu *head,*p1,*p2;
	p2=p1=(struct stu *) malloc (sizeof(struct stu));
	gets(p1->a);
	p1->next=0;
	while(!(p1->a[0]==101&&p1->a[1]==110&&p1->a[2]==100))
	{
		p1=(struct stu *) malloc (sizeof(struct stu));
		gets(p1->a);
		p1->next=p2;
		p2=p1;
	}
	return p1->next;
}
void print (struct stu *p)
{
	while(p!=0)
	{
		printf("%s\n",p->a);
		p=p->next;
	}
}
int main()
{
	struct stu *p;
	p=create();
	print(p);
	return 0;
}
struct student
{char info[100];
struct student *next1;
struct student *next2;
};
int n,i;
struct student *creat(void)
{
struct student *p1,*p2,*p3;
n=0;
p3=p2=p1=(struct student*)malloc(LEN);
gets(p1->info);
while(p1->info[0]!='e')
{
n+=1;
if(n==1){p2->next1=p1;
p2->next2=NULL;}
else {p2->next1=p1;
p2->next2=p3;}
p3=p2;
p1=(struct student *)malloc(LEN);
gets(p1->info);
p2=p1;
}
p3->next1=NULL;
return p3;
}

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

int main()
{struct student *top;
top=creat();
print(top);
}
char str[]={"end"};
struct student
{
	char num[100];
	char name[100];
	char sex;
	int age;
	char score[100000];
	char add[100];
	struct student *next;
};
struct student *create()
{
	struct student *head,*p1,*p2;
	p1=(struct student*)malloc(Len);
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->add);
	p1->next=NULL;
	p2=p1;
    p1=(struct student*)malloc(Len);
	for(;;)
    {scanf("%s",p1->num);
	if(!strcmp(p1->num,str)) break;
	else
	{
       scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
	p1->next=p2;
	p2=p1;
	p1=(struct student*)malloc(Len);
	}
	}
	head=p2;return(head);
	
}
void main()
{
	struct student *p;
	
	p=create();
	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);
	
	
}
struct student
{
      char a[100];
      char b[100];
      char c;
      int d;
      char e[100];
      char f[100];
      struct student *t;
      }k[1000];
int n;
int main()
{ int i;
    struct student *head,*p;
  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);
     if(i>0)
     k[i].t=&k[i-1];
     if(i==0)
     k[i].t=NULL;
  }
  head=&k[i-1];
  p=head;
  do{
  printf("%s %s %c %d %s %s\n",p->a,p->b,p->c,p->d,p->e,p->f);
  p=p->t;}
  while(p!=NULL);
  return 0;
}
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;
	struct Student*head;
	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;
            if(n==1)head=p1;
            else
			{
			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;
	}
}
void main()
{
	struct student
{
	char stu[100];
	struct student *next;
	struct student *prev;
}*head,*p1,*p2,*p;
	
	int n;
	p1=p2=(struct student *)malloc(LEN);
	gets(p1->stu);
	p1->prev=NULL;
	while(strcmp(p1->stu,"end")!=0)
	{
		p1=(struct student*)malloc(LEN);
		p1->prev=p2;
		gets(p1->stu);
		p2->next=p1;
		p2=p1;
	}
	p2->next=NULL;
	
	p=p2;

		do
		{
			p=p->prev;
			printf("%s\n",p->stu);
			
		}while(p->prev!=NULL);
	}
struct Student
 {
	char num[50];
	char name[50];
	char x;
	int age;
	float score;
	char ad[50];
	struct Student *next;
 };

struct Student *create(void)
{
	struct Student *head,*p1,*p2;
	int n=0;
	char end[5]="end\0";
	p1=(struct Student*)malloc(LEN);
	p2=p1;
	scanf("%s",p1->num);
	scanf("%s %c%d%f%s",p1->name,&p1->x,&p1->age,&p1->score,p1->ad);
	head=NULL;
	for(;;)
	{
	 n=n+1;
	 if(n==1)head=p1;
	 else p1->next=head;
	 head=p1;
	 p1=(struct Student*)malloc(LEN);

	 scanf("%s",p1->num);
	 if(strcmp(p1->num,end)==0)break;
	 scanf("%s %c%d%f%s",p1->name,&p1->x,&p1->age,&p1->score,p1->ad);
    }
	p2->next=NULL;
	return(head);
}
void print(struct Student *head)
{   struct Student *p;
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->x,p->age,p->score,p->ad);
		p=p->next;
    };

}
main()
{
	struct Student *pt;
	pt=create();
	print(pt);

}
void main()
{
 struct student
{
 char str[100];
 struct student *before;
 struct student *next;
 }*head,*p1,*p2;
 p1=(struct student *)malloc(sizeof(struct student));
 p1->before=NULL;
 head=p1;
 while(strcmp(p2->str,"end")!=0)
 {
  gets(p1->str);
  p2=p1;
  p1=(struct student*)malloc(sizeof(struct student)); 
  p1->before=p2;
  p2->next=p1;
 }
  p2->next=NULL; 
  p2=p2->before;
  do
  {
   printf("%s\n",p2->str);
   p2=p2->before;
  }while(p2->before!=NULL);
  printf("%s\n",p2->str);
}
struct stu
{
	char num[20];
	char name[20];
	char sex;
	int age;
	double x;
	char add[20];
	struct stu *next;
};

struct stu *creat()
{
	struct stu *head,*p1,*p2;
	p1=(struct stu *)malloc(LEN);
	scanf("%s %s %c %d %lf %s ",&p1->num,&p1->name,&p1->sex,&p1->age,&p1->x,&p1->add);
	p2=p1;head=p1;
	p1->next=NULL;
	while(1)
	{
	p1=(struct stu *)malloc(LEN);
	scanf("%s ",&p1->num);
	if(p1->num[0]!='e')
	{
	    scanf("%s %c %d %lf %s ",&p1->name,&p1->sex,&p1->age,&p1->x,&p1->add);
	    p1->next=p2;
	    p2=p1;
	}
	else
		break;
	}
	return p2;
}
void print(struct stu *head)
{
	struct stu *p;
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->x,p->add);
		p=p->next;
	}
}
void destroy(struct stu *head)
{
	struct stu *p;
	while(head)
	{
		p=head;
		head=head->next;
		free(p);
	}
}

int main()
{
	struct stu *head;
	head=creat();
	print(head);
	destroy(head);
	return 0;
}
struct student
{
	char num[10];
	char name[20];
	char sex;
	int age;
	char score[20];
	char address[50];
    struct student *next;
};
void main()
{
	struct student *p,*head,*q;
	p=(struct student*)calloc(1000,sizeof(struct student));
	int i,k;
	for(i=0;;i++)
	{
		scanf("%s",p[i].num);
        if(p[i].num[0]=='e')
			break;
		scanf("%s %c %d %s %s",p[i].name,&p[i].sex,&p[i].age,p[i].score,p[i].address);
	}
    k=i-1;
	head=&p[k];
	for(i=k;i>=1;i--)
		p[i].next=&p[i-1];
	p[0].next=NULL;
	q=head;
	do
	{
		printf("%s %s %c %d %s %s\n",q->num,q->name,q->sex,q->age,q->score,q->address);
		q=q->next;
	}
	while(q!=NULL);
}
struct stu
{char a[100];
struct stu *next;
};
int main()
{struct stu *head,*p1,*p2;
head=(struct stu *)malloc(sizeof(struct stu));
p1=head;
p2=head;
p1->next=0;
    while(1)
{
    gets(p1->a);
    if(strcmp(p1->a,"end")==0)
    break;
    else
    head=p1;
    p1=(struct stu *)malloc(sizeof(struct stu));
  
   p1->next=p2;
   p2=p1;
}

p1=head;
while(1)
{
puts(p1->a);
if(p1->next==0)
break;
p1=p1->next;
}
  
   return 0;
}
main()
{
int doit(int a);
doit(1);
}

int doit(int r)
{
char a[20],b[20],c[20],d[20],e[20],f[20];
scanf("%s",a);
if (a[0]!='e') { scanf("%s",b);scanf("%s",c);scanf("%s",d);scanf("%s",e);scanf("%s",f);
	            doit(1);}
else return 0;
printf("%s %s %s %s %s %s\n",a,b,c,d,e,f);
}
struct student{
	struct student *pre;
    char No[10];
	char name[20];
	char sex;
	int age;
	float grade;
	char address[20];
	struct student *next;
};
struct student *create(){
    struct student *head,*p1,*p2,*h,*p;
	p1=(struct student *)malloc(sizeof(struct student));
	scanf("%s",p1->No);
	if(p1->No[0]=='e'){
	    free(p1);
		head=NULL;
		return head;
	}
	else{
	    scanf("%s",p1->name);
		getchar();
		scanf("%c",&p1->sex);
		scanf("%d",&p1->age);
		scanf("%f",&p1->grade);
		scanf("%s",p1->address);
		p1->next=NULL;
	}
	head=p1;
	p2=p1;
	for(;;){
        p1=(struct student *)malloc(sizeof(struct student));
	    scanf("%s",p1->No);
	    if(p1->No[0]=='e'){
			head->pre=NULL;
		    for(h=head;h->next!=NULL;){
		    p=h->next;
			p->pre=h;
			h=h->next;
		}
	    free(p1);
		return head;
		}
	    else{
	    scanf("%s",p1->name);
		getchar();
		scanf("%c",&p1->sex);
		scanf("%d",&p1->age);
		scanf("%f",&p1->grade);
		scanf("%s",p1->address);
		p1->next=NULL;
		}
		p2->next=p1;
		p2=p1;
	}
}
void destroy(struct student *head){
    struct student *p;
	for(;head!=NULL;){
	    p=head;
        head=head->next;
		free(p);
	}
}
void main()
{
	struct student *h,*t,*h1;
	h=create();
    for(h1=h;h1->next!=NULL;){
	    h1=h1->next;
	}
	for(t=h1;t!=NULL;t=t->pre){
	printf("%s %s %c %d %g %s\n",t->No,t->name,t->sex,t->age,t->grade,t->address);
    }
	destroy(h);
}
main()
{
	struct a
	{
		char s[100];
		struct a *next;
	};
	int len=sizeof(struct a),n=0;
	struct a *p1,*p2,*head,*p;
	p1=p2=(struct a *)malloc(len);
	head=NULL;
	gets(p1->s);
	while(strcmp(p1->s,"end")!=0)
	{
		n++;
		if(n==1)
			head=p1;
		else
			p1->next=p2;
		p2=p1;
		p1=(struct a *)malloc(len);
		gets(p1->s);
	}
	head->next=NULL;
	p=p2;
	if(head!=NULL)
	{
		do
		{
			puts(p->s);
			p=p->next;
		}while(p!=NULL);
	}
}
struct Student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char add[20];
	struct Student *next;
};
int n;
struct Student *creat()
{
	struct Student *head,*p1,*p2;
	p1=p2=(struct Student *) malloc(LEN);				
	scanf("%s",&p1->num);
	while(p1->num[0]!='e')
	{
		n++;
		scanf("%s %c %d %s %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add);
		if(n==1) p1->next=NULL;
		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!=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);
}
int main()
{
	struct student
	{
		char imfor[100];
		struct student *early;
	};

	int m;
	struct student *p1,*p2,*last,*p;
	p1=p2=(struct student *)malloc(sizeof(struct student));
	gets(p1->imfor);
	p1->early=0;
	for (m=1;m<1000;m++)
	{
		p1=(struct student * )malloc(sizeof(struct student));
		p1->early=p2;
		p2=p1;
		gets(p1->imfor);
		if (p1->imfor[0]=='e')
		{
			last=p1->early;
			break;
		}

	}
	p=last;
	for (m=1;m<1000;m++)
	{
		printf("%s\n",p->imfor);
		p=p->early;
		if (p==0)
		{
			break;
		}
	}
}
struct student
{
       char num[20];
       char name[20];
       char sex;
       int age;
       double score;
       char address[20];
       struct student *next;
       struct student *former;
       };
        
main()
{
      struct student *p,*p1,*p2,*header;
        header=(struct student *)malloc(sizeof(struct student));
        header->next=header->former=NULL;
        p2=header;
       for(;;)
        {
           p1=(struct student *)malloc(sizeof(struct student));
           p2->next=p1;
           p1->former=p2;
           scanf("%s",p1->num);
           if(p1->num[0]=='e'&&p1->num[1]=='n'&&p1->num[2]=='d') break;
           scanf("%s %c %d %lf %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->address);
           p2=p1;
           }
        p2->next=NULL;
        free(p1);
               p=p2;
               for(;p->former!=NULL;)
               {
                 if(p->score==(int)(p->score))

                 printf("%s %s %c %d %d %s\n",p->num,p->name,p->sex,p->age,(int)(p->score),p->address);

                 else printf("%s %s %c %d %.1lf %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
                 p=p->former;
                 }
      p1=p2;
      for(;p1->former!=NULL;)
      {
       p2=p1;
       p1=p2->former;
       free(p2);
       }
       free(p1);      

      }
struct stru
{
	struct stru *pre;
	char msg[200];
	struct stru *next;
}*head, *p,*q,*end;

void creat()
{
	char temp[200];
	p=q=(struct stru *)malloc(LEN);
	head=p;
	head->pre=NULL;
	gets(p->msg);
	while(1)
	{
		gets(temp);
		if(strcmp(temp,"end")!=0)
		{p=(struct stru *)malloc(LEN);
		strcpy(p->msg,temp);
		p->pre=q;
		q->next=p;
		q=p;}
		else
			break;
	}
	q->next=NULL;
	end=q;
}

void print(struct stru *end)
{
	for(p=end;p!=NULL;p=p->pre)
		printf("%s\n",p->msg);
}

void main()
{
	creat();
	print(end);
}
struct student 
{
	char id[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char address[20];
	struct student *next;
	struct student *pre;
};
struct student *create(void)
{
	struct student *head,*p1,*p2,*end;
	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;
	p1->pre=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;
		    p1->pre=NULL;
			p2->next=p1;
			p1->pre=p2;
			p2=p1;
		}
	}while(1);
	end=p2;
	return(end);
}
void print(struct student*end)
{
	struct student*p;
	p=end;
	while(p)
	{
		printf("%s %s %c %d %s %s\n",p->id,p->name,p->sex,p->age,p->score,p->address);
		p=p->pre;
	}
}

int main()
{
	struct student *end;
	end=create();
	print(end);
}
int n;
struct student
{
	char str[100];
	struct student *pre;
} *p1, *p2;

struct student *create(void)
{   
	struct student *last, *head;	
	p1 = p2 = (struct student *)malloc(sizeof(struct student)); //????
	gets(p1->str);//?????
	head=NULL;
	n=0;	
	while (strcmp(p1->str,"end")!=0)
	{	
		    n=n+1;	//??????	
		if (n==1)		
		{   
			head=p1;
			p1->pre = NULL;//??????pre??			
		}		
		else		
		{
			p1->pre = p2;//????pre????????
			
		}
		    p2 = p1;//?????
		    p1 = (struct student *)malloc(sizeof(struct student));//????
			gets(p1->str);	
			
	}
	last=p1->pre=p2;	    
	return (last);
}
void main ()
{    
	 struct student *create();
	 struct student *last, *p;	 
	 last=create();
	 p=last;
    do
	 {
          printf("%s\n", p->str);
            p=p->pre;
	 }	 
	 while (p->pre!=NULL);
	 if(p->pre==NULL)
      printf("%s\n", p->str);

}
struct stu
{
	char num[10];
	char name[20];
	char sex;
	int age;
	float mark[6];
	char add[10];
	struct stu *next;
};
int n;
struct stu *creat(void)
{
	struct stu *head;
	struct stu *p1,*p2;
	n=0;
	p1=p2=(struct stu *)malloc(sizeof(struct stu));
	scanf("%s",p1->num);
	if(strcmp(p1->num,"end")==0)
	{
		free(p1);
		head=NULL;
		return head;
	}
	else 
	{
		scanf(A,p1->name,&p1->sex,&p1->age,p1->mark,p1->add);
		head=p1;
		p2=p1;
		p1->next=NULL;
		do
		{
			p1=(struct stu *)malloc(sizeof(struct stu));
			scanf("%s",p1->num);
			if(strcmp(p1->num,"end")==0)
			{
		         free(p1);
		         break;
			}
			else
			{
				scanf(A,p1->name,&p1->sex,&p1->age,p1->mark,p1->add);
				head=p1;
				p1->next=p2;
				p2=p1;
			}
		}while(1);
		return head;
	}
}

int main(void)
{
	struct stu *p;
	struct stu *head;
	p=creat();
	while(p)
	{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->mark,p->add);
		p=p->next;
	}
}
struct stu
{
	char num[111];
	char name[111];
	char gender;
    int age;
	char score[11111];
	char add[111];
	struct stu *next;
};
int n;
struct stu *creat()
{

	struct stu *head;
	struct stu *p1,*p2;
	n=0;
	p1=(struct stu *)malloc(L);
    scanf("%s",p1->num);
    if(strcmp(p1->num,"end"))
		scanf("%s %c %d %s %s",p1->name,&p1->gender,&p1->age,p1->score,p1->add);
	else return NULL;
    while(1)
	{
		n=n+1;
		if(n==1) p1->next=NULL;
		else p1->next=p2;
		p2=p1;
		p1=(struct stu *)malloc(L);
		scanf("%s",p1->num);
	    if(strcmp(p1->num,"end"))
		scanf("%s %c %d %s %s",p1->name,&p1->gender,&p1->age,p1->score,p1->add);
		else break;	
	}
	head=p2;
	return(head);
}


void main()
{
	int i;
	struct stu *p;
	p=creat();
	while(p)
	{	
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->gender,p->age,p->score,p->add);
		p=p->next;
	
	}
}
struct student
{
 char xuehao[20];
 char name[30];
 char sex;
 int age;
 char score[20];
 char adress[40];
 struct student *next;
};
void insert (struct student *pheader)
{
 struct student *p;
 p=(struct student *)malloc(sizeof(struct student));
 p->next=pheader->next;
 pheader->next=p;
}
main()
{
 struct student *pheader,*p;
 pheader=(struct student *)malloc(sizeof(struct student));
 pheader->next=NULL;
 while(9)
 {
  insert(pheader);
  scanf("%s",pheader->next->xuehao);
  if(pheader->next->xuehao[0]=='e')
    break;
  scanf("%s %c %d %s %s",pheader->next->name,&pheader->next->sex,&pheader->next->age,&pheader->next->score,pheader->next->adress);
 }
 p=pheader->next;
 while(9)
 {
   p=p->next;
   printf("%s %s %c %d %s %s\n",p->xuehao,p->name,p->sex,p->age,p->score,p->adress);
   if(p->next==NULL)
     break;
 }
 while(9){
 if(pheader->next->next==NULL)
   break;
 p=pheader->next;
 pheader->next=p->next;
 free(p);}
 free(pheader->next);
 free(pheader);
}
int main()
{
	char	s[1000][100];
	int	i;
	for (i=0,gets(s[i]); s[i][0]!='e'; gets(s[i])) i++;
	for (i--;i!=-1; i--) puts(s[i]);
	return 0;
}
struct student
{
            char str[50];
            struct student *next;
            };
struct student *creat()
{
       struct student *head=NULL,*p1,*p2;
       p1=p2=(struct student*)malloc(Len);
       gets(p1->str);
       while(strcmp(p1->str,"end")!=0)
       {
                           
                           if(head==NULL)head=p1;
                           else p2->next=p1;
                           p2=p1;
                           p1=(struct student*)malloc(Len);
                           gets(p1->str);
       }
       p2->next=NULL;
       return(head);
}

struct student *re(struct student *head)
{
       struct student *p1,*p2,*newhead=NULL,*n;
       do
       {p1=head;
       p2=NULL;
       while(p1->next!=NULL)p2=p1,p1=p1->next;
       if(newhead==NULL)newhead=p1,n=newhead->next=p2;
       n=n->next=p2;
       p2->next=NULL;
       }while(head->next!=NULL);
       return(newhead);
}


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();
     head=re(head);
     print(head);
     
 
}
char ex[4]={"end"};
struct student
{
	char n[100];
	struct student *next;
};
void main()
{
	int n=0;
	struct student *a=NULL,*b=NULL;
	struct student *head,*p1,*p2;
	head=NULL;
	p1=(struct student*)malloc(LEN);
	p2=NULL;
	gets(p1->n);
	while(strcmp(ex,p1->n)!=0)
	{
		p1->next=p2;
		p2=p1;
		p1=(struct student*)malloc(LEN);
		gets(p1->n);
	}
	p1=NULL;
	head=p2;
	a=head;
	while(a!=NULL)
	{
		puts(a->n);
		b=a->next;
		a=b;
	}
}
typedef struct Student
{
	char ALL[100];
	struct Student *pNext;
	struct Student *pPrev;
}Stu;
int main(void)
{
	Stu *pRoot=(Stu *)malloc(sizeof(Stu));
	Stu *pNow=pRoot;
	pRoot->pPrev=NULL;
	for(;;)
	{
		gets(pNow->ALL);
		if(strcmp("end",pNow->ALL))
		{
			pNow->pNext=(Stu *)malloc(sizeof(Stu));
			pNow->pNext->pPrev=pNow;
			pNow=pNow->pNext;
		}
		else break;
	}
	pNow=pNow->pPrev;
	for(;;)
	{
		puts(pNow->ALL);
		if(pNow->pPrev==NULL) break;
		pNow=pNow->pPrev;
	}
	return 0;
}