semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*°ü?0?8¨?0?6?0?0?0?0?0?7?0?4?0?4?0?5?0?1?0?1?0?7?0?6?0?3?0?4?0?4?0?9?0?4?0?8?0?5?0?6?0?3?0?0?0?2?0?5§?0?7ú?0?8?0?2?0?4?0?3?0?3?0?4?0?5?0?1?0?6?0?4?0?5?0?2 
00630018 zhouyan m 20 10.0 28#460 
?0?8?0?1?0?6?0?5?0?8?0?2×?0?6?0?2ó?0?6?0?8"end"?0?5á?0?8?0?3
?0?1?0?1?0?7?0?3?0?8?0?1?0?6?0?2 
?0?5?0?0?0?8?0?1?0?6?0?5?0?8?0?2?0?2?0?3?0?6?0?6°?0?7?0?9?0?9 
?0?5§?0?2?0?3 ?0?4?0?9?0?1?0?4 ?0?4?0?8±?0?8 ?0?2ê?0?9?0?1 ?0?8?0?1·?0?0 ?0?8?0?1?0?0· 
?0?8?0?2?0?0?0?9?0?8?0?5?0?8?0?1?0?4ò?0?8?0?1?0?6?0?2 */
struct student
{
	char info[100];
	struct student *pre;
};
struct student *creat()
{
	struct student *head,*p1,*p2;
	head=(struct student *)malloc(sizeof(struct student));
	p1=head;
	head->pre=0;
	while(1)
	{
		gets(p1->info);
		if(p1->info[0]=='e')
		{
			return p1->pre;
		}
		else
		{
			p2=(struct student *)malloc(sizeof(struct student));
			p2->pre=p1;
			p1=p2;
		}
	}
}
int main()
{
	struct student *p;
	p=creat();
	while(p!=0)
	{
		printf("%s\n",p->info);
		p=p->pre;
	}
	return 0;
}
/*00630018 zhouyan m 20 10 28#4600
0063001 zhouyn f 21 100 28#460000
0063008 zhoyan f 20 1000 28#460000
0063018 zhouan m 21 10000 28#4600000
00613018 zhuyan m 20 100 28#4600
00160018 zouyan f 21 100 28#4600
01030018 houyan m 20 10 28#4600
0630018 zuyan m 21 100 28#4600
10630018 zouan m 20 10 28#46000
end
10630018 zouan m 20 10 28#46000
0630018 zuyan m 21 100 28#4600
01030018 houyan m 20 10 28#4600
00160018 zouyan f 21 100 28#4600
00613018 zhuyan m 20 100 28#4600
0063018 zhouan m 21 10000 28#4600000
0063008 zhoyan f 20 1000 28#460000
0063001 zhouyn f 21 100 28#460000
Press any key to continue*/
struct student{
       char num[20];
	   char name[30];
	   char sex;
	   int age;
	   float score;
	   char adress[30];
	   struct student *next;
	   struct student *last;
};

int n=1;

struct student *ANewNode(void)
{
	struct student *head=NULL,*newnode,*thisnode;
    
	do
	{
		newnode=(struct student *)malloc(sizeof(struct student));
		scanf("%s",newnode->num);
	    if(strcmp(newnode->num,"end")==0)
		{
			thisnode->next=NULL;
			head=thisnode;
			break;
		}
		else;
        scanf("%s %c %d %f %s",newnode->name,&newnode->sex,&newnode->age,&newnode->score,newnode->adress);
		if(n==1)
		{
			head=newnode;
			thisnode=head;
			thisnode->last=NULL;
		}
		else
		{
			thisnode->next=newnode;
			newnode->last=thisnode;
		}
			thisnode=newnode;
			n=n+1;
		
	}while(strcmp(newnode->num,"enff")!=0);
	return(head);
}
		  
int main()
{
    struct student *head,*p;

	head=ANewNode();

	p=head;
	do
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->adress);
		p=p->last;
	}while(p!=NULL);
	scanf("%d",&n);
 return 0;
}
struct student{
		char name[100];
		char ind[100];		
		char sex;
		int age;
		float score;
		char dizhi[100];
		struct student *next;
};//?? ?? ?? ?? ?? ?? 
int n;
struct student *creat()
{
	struct student *p1,*p2;
	n=0;
	p1=(struct student *)malloc(LEN);
	p2=(struct student *)malloc(LEN);
	scanf("%s %s %c %d %f %s",&p1->ind,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->dizhi);
	p1->next=0;
	while(strcmp(p2->ind,"end")!=0)
	{
		n++;
		if(n==1)scanf("%s %s %c %d %f %s",&p2->ind,&p2->name,&p2->sex,&p2->age,&p2->score,&p2->dizhi);
		else scanf("%s %c %d %f %s",&p2->name,&p2->sex,&p2->age,&p2->score,&p2->dizhi);
		p2->next=p1;
		p1=p2;
		p2=(struct student *)malloc(LEN);
		scanf("%s",&p2->ind);

	}
	return p1;
}
void main()
{
	struct student *wr;
	wr=creat();
	printf("%s %s %c %d %g %s\n",wr->ind,wr->name,wr->sex,wr->age,wr->score,wr->dizhi);
       //printf("10630018 zouan m 20 10 28#46000\n");
	while(wr->next!=0){
				wr=wr->next;
		printf("%s %s %c %d %g %s\n",wr->ind,wr->name,wr->sex,wr->age,wr->score,wr->dizhi);

		}

}
struct node
{
	char num[20];
	char name[20];
	char gender;
	int age;
	char score[10];
	char addr[20];
	struct node *next;
	struct node *back;
};
void main()
{
	char scan[100],constant[]="end";
	struct node beginning,*head,*p,*ending,*t;
	int count=1,i;
	head=&beginning;
	beginning.next=NULL;
	beginning.back=NULL;
	p=head;
	ending=p;
	scanf("%s %s %c %d %s %s",beginning.num,beginning.name,&beginning.gender,&beginning.age,beginning.score,beginning.addr);
	scanf("%s",scan);
	while(strcmp(scan,constant)!=0)
	{
		p->next=(struct node *)malloc(sizeof(struct node));
		t=p;
		p=p->next;
		strcpy(p->num,scan);
		scanf("%s %c %d %s %s",p->name,&p->gender,&p->age,p->score,p->addr);
		p->back=t;
		ending=p;
		scanf("%s",scan);
		count++;
	}
	p=ending;
	for(i=1;i<=count;i++)
	{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->gender,p->age,p->score,p->addr);
		p=p->back;
	}
}
struct aa
	{
		char data[100];
		struct aa* next;
	};
void print(struct aa* p)
{
	if (p->next!=NULL) print(p->next);
	cout <<p->data<<endl;
}
int main()
{
	
	struct aa *head,*p,*q;
	int si=sizeof(struct aa);
	head=(struct aa*)malloc(si);
	p=head;q=head;
	char s[100];
	while (cin.getline(s,100))
		if (strcmp(s,"end"))
		{
			q=(struct aa*)malloc(si);
			p->next=q;
			strcpy(q->data,s);
			q->next=NULL;
			p=q;
		}
		else break;
	print(head->next);
	return 0;
}
struct student
{
	char stu[100];
}a[10000];
void main()
{
	int i,j;
	for(i=0;;i++)
	{
		gets(a[i].stu);
		if(a[i].stu[0]=='e')
		{
			a[i].stu[0]='\0';
			break;
		}
	}
	for(j=i;j>=0;j--)
	{
		puts(a[j].stu);
	}
}
struct student
{
	char xh[1000];
	struct student *next;
	struct student *last;
};
int n;
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	p1=(struct student*)malloc(sizeof(struct student));
	p2=p1;
	gets(p1->xh);
         head=NULL;
	p1->last=NULL;
	for(n=1;strcmp(p1->xh,"end")!=0;n++)
	{
		if(n==1) head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student*)malloc(sizeof(struct student));
		gets(p1->xh);
		if(strcmp(p1->xh,"end")==0) break;
		p1->last=p2;
	}
	head=p2;
	p2->next=NULL;
	return(head);
}
void print(struct student *head)
{
	struct student *p;
	p=head;
	if(head!=NULL)
		for(;p!=NULL;)
		{
			printf("%s\n",p->xh);
			p=p->last;
		}
}
void main()
{
	struct student *head;
	head=creat();
	print(head);
}
struct stu
{
       char ss[10000];
       struct stu *next;
};
int main()
{
    long int i,j,k,l,m,n;
    struct stu *p,*p1;
    p1=p=(struct stu*)malloc(len);
    p1=null;
    while (1)
    {
          p=(struct stu*)malloc(len);
          gets(p->ss);
          p->next=p1;
          p1=p;
          if (strcmp(p->ss,"end\0")==0) break;
    }
    p=p->next;
    while (p!=null)
    {
          puts(p->ss);
          p=p->next;
    }
    scanf("%d",&i);
}
struct student
{
	char xuehao[100];
	char name[100];
	char s;
	int age;
	float score;
	char add[100];
	
};



int main()
{
	int i,j,n=0;
	struct student stu[1000];
	for(i=0;i<1000;i++)
	{
		scanf("%s",stu[i].xuehao);
		if(stu[i].xuehao[0]=='e'&&stu[i].xuehao[1]=='n'&&stu[i].xuehao[2]=='d') break;
		scanf("%s %c %d %f %s",stu[i].name,&stu[i].s,&stu[i].age,&stu[i].score,stu[i].add);
		n++;
	}
	for(j=n-1;j>=0;j--)
	{
		if((int)stu[j].score==stu[j].score)
		printf("%s %s %c %d %d %s\n",stu[j].xuehao,stu[j].name,stu[j].s,stu[j].age,(int)stu[j].score,stu[j].add);
		else
			printf("%s %s %c %d %.1f %s\n",stu[j].xuehao,stu[j].name,stu[j].s,stu[j].age,stu[j].score,stu[j].add);

	}
	return 0;
}
struct stu
{
       char a[50];
       struct stu* b;
};
int main()
{
struct stu* p1,* p2,stu;
p1=p2=&stu;
p1->b=NULL;
gets(p1->a);
for(;;)
{
       if(strcmp(p2->a,"end")==0)  break;
       p2=(struct stu*)malloc(N); 
       gets(p2->a);
       p2->b=p1;
       p1=p2;
      
} 
p2=p2->b;
for(;;)
{
       printf("%s",p2->a);
       if(p2->b==NULL) break;
       p2=p2->b;  
       printf("\n");
}

}
struct student
{
	char num[20];
	char name[20];
	char sex[2];
	char age[20];
	char score[10];
	char add[20];
	struct student *next;
}*head,*p;
void input()
{
	head=NULL;
	int n=0;
	do
	{
		p=(struct student *)malloc(LEN);
		scanf("%s",p->num);
		if(p->num[0]=='e')
			break;
		scanf("%s%s%s%s%s",p->name,p->sex,&p->age,&p->score,p->add);
		n++;
		if(n==1)
			p->next=NULL;
		else
			p->next=head;
		head=p;
	}while(1);
	p=head;
}
void output()
{
		if(head!=NULL)
	{
		do
		{
			printf("%s %s %s %s %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
			p=p->next;
		}while(p!=NULL);
	}
}
void main()
{
	input();
	output();
}
void main()
{
struct student{
char a[20];
char b[20];
char c;
int d;
float e;
char f[20];
struct student *next;
};
struct student *head,*p1,*p0;int n=0;
p1=(struct student*) malloc(LEN);
scanf("%s",p1->a);
head=p1;
p1->next=0;
while(strcmp(head->a,"end")!=0)
{
n++;
if(n>1) p1=p0;
scanf("%s %c %d %f %s",head->b,&head->c,&head->d,&head->e,head->f);
p0=(struct student*) malloc(LEN);
head=p0;
p0->next=p1;
scanf("%s",p0->a);
}
head=p1;
for(p1=head;(p1!=0)&&(strcmp(p1->a,"end")!=0);)
{
printf("%s %s %c %d %g %s\n",p1->a,p1->b,p1->c,p1->d,p1->e,p1->f);
p1=p1->next;
}
}
struct student
{
	char id[20];
	char name[30];
	char sex;
	int age;
	char score[30];
	char add[30];
	struct student *next;
    struct student *adv;
};
int n;
void main()
{
	struct student *p,*q,*head;
	n=0;
	p=q=(struct student *)malloc(LEN);
	scanf("%s %s %c %d %s %s",p->id,p->name,&(*(p)).sex,&(*(p)).age,p->score,p->add);
    head=NULL;
	while(strcmp(p->id,"end")!=0)
	{
		n=n+1;
		if(n==1) {p->adv=NULL;head=p;}
		else q->next=p;
		p->adv=q;
		q=p;
	
		p=(struct student *)malloc(LEN);
		scanf("%s %s %c %d %s %s",p->id,p->name,&p->sex,&p->age,p->score,p->add);
		
	}
    q->next=NULL;
    while(q!=NULL)
	{
		if(q!=head)
		{printf("%s %s %c %d %s %s\n",q->id,q->name,(*(q)).sex,(*(q)).age,q->score,q->add);
		q=q->adv;}
		else {printf("%s %s %c %d %s %s\n",head->id,head->name,(*(head)).sex,(*(head)).age,head->score,head->add);break;}
	}
}
struct stu
{
	struct stu *back;
	char info[number];
	struct stu *next;
}
main()
{
	char infos[number];
	char s[]="end";
	struct stu *head,*p1,*p2,*tail;
	
	gets(infos);
	p2=(struct stu *)malloc(Len);
	if (strcmp(infos,s)!=0)
	{
		head=p2;
		p2->back=NULL;
		strcpy(p2->info,infos);
		p2->next=NULL;
		gets(infos);
		p1=p2;
	}
	while(strcmp(infos,s)!=0)
	{
		p2=(struct stu *)malloc(Len);
		p1->next=p2;
		p2->back=p1;
		strcpy(p2->info,infos);
		p2->next=NULL;
		p1=p2;
		gets(infos);
	}
	tail=p1;
	while(p1)
	{
		printf("%s\n",p1->info);
		p1=p1->back;
	}
}
struct student
{
	char xuehao[200];
	char name[300];
	char xingbie;
	char age[20];
	char grade[20];
	char dizhi[200];
	struct student *next;
};
int main()
{
	int i;
	int n=0;
    struct student *tail;
	struct student *p1,*p2,*p;
	tail=NULL;
	p1=p2=NULL;  	
	for(i=1;;)
	{
		p1=(struct student*)malloc(LEN);
		p1->next=p2;
		scanf("%s",p1->xuehao);
		if(strcmp(p1->xuehao,"end")==0)
		{
			tail=p2;
			     break;
		}
		scanf("%s",p1->name);
		getchar();
		scanf("%c",&p1->xingbie);
		scanf("%s",p1->age);
		scanf("%s",p1->grade);
		scanf("%s",p1->dizhi);
		p2=p1;
        i++;
	}
	n=i-1;
A:  p=tail;
    for(;p!=NULL;)
	{
		printf("%s %s %c %s %s %s\n",p->xuehao,p->name,p->xingbie,p->age,p->grade,p->dizhi);
		p=p->next;
	}
	return 0;
}
void main()
{
	char *juzi[1000];
	char **p;

	p=juzi;
	*p=(char *)malloc(100*sizeof(char));
	gets(*p);
	while(strcmp(*p,"end")!=0)
	{
		p++;
		*p=(char *)malloc(100*sizeof(char));
		gets(*p);
	
	}
    p--;
	for(;p>=juzi;p--)
		puts(*p);

}
struct arr
{
	char num[20];
	char name[50];
	char sex;
	int age;
	float score;
	char address[50];
	struct arr *next;
};
int n;

struct arr *create(void)                   
{
	struct arr *head;
	struct arr *p1,*p2;
	n=0;
	p1=p2=(struct arr *)malloc(LEN);
	scanf("%s %s %c %d %f %s",&p1->num,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->address);                           
	head=NULL;
	while(strcmp(p1->num,"end")!=0)
	{
		n=n+1;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct arr *)malloc(LEN);
		scanf("%s",&p1->num );
		if(strcmp(p1->num,"end")==0)break;
		scanf("%s %c %d %f %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->address);
	}
	p2->next=NULL;
	return(head);
}
struct arr *reverse(struct arr *head)
{
	struct arr *p1,*p2,*p3;
	p1=p2=head;
	if(p1!=NULL&&p1->next!=NULL)
	{
		p1=p1->next;
		p2->next=NULL;
		while(p1!=NULL&&p1->next!=NULL)
		{
			p3=p1;
			p1=p1->next;
			p3->next=p2;
			p2=p3;
		}
		head=p1;
		p1->next=p2;
	}
	return(head);
}
void print(struct arr *head)
{
	int b;
	struct arr *p1;
	p1=head;
	while(p1!=NULL)
	{
		b=(int)p1->score;
		if(p1->score-b==0.0)
		printf("%s %s %c %d %d %s\n",p1->num,p1->name,p1->sex,p1->age,b,p1->address);       
		else
			printf("%s %s %c %d %.1f %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->address); 
		p1=p1->next;
	}
}

void freelist(struct arr *head)
	{
		struct arr *p=head ;
		while(p!=NULL)
		{
			head=head->next;
			free(p);
			p=head;
		}
}
void main()
{ 
	struct arr *head;
	head=create();
	head=reverse(head);
	print(head);
	freelist(head);
}
struct student
{
  char name[50];
  struct student *next;
  struct student *former;
};//????????

void main()
{
  struct student *head1,*head2;
  struct student *p1,*p2;
  
    

  p1=p2=(struct student*)malloc(LEN);
  gets(p1->name);
  p1->next=NULL;  //???p1->next???
  p1->former=NULL;
  head1=p1;
  
  while(strcmp(p1->name,"end"))
  {
   	p2=p1;
	p1=(struct student*)malloc(LEN);
    gets(p1->name);
	
	p1->next=NULL;
	p1->former=p2;
	p2->next=p1;
  }
  p2->next=NULL;

  do
  {
    puts(p2->name);
	p2=p2->former;
  }
  while(p2!=NULL);

}
struct Student
{
	char num[1000];
	char name[1000];
	char sex;
	int age;
	char score[1000];
	char add[1000];
	struct Student * next;
	struct Student * pre;
};
int n;
struct Student * creat(void)
{
	struct Student * head,* end;
	struct Student * p1,* p2;
	n=0;
	p1=p2=(struct Student *)malloc(LEN);
	scanf("%s",p1->num);
	head=NULL;
	while(p1->num[0]!='e')
	{
		scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		n++;
		if(n==1)	{	head=p1;	p1->pre=NULL;	}
		else		{	p2->next=p1;	p1->pre=p2;	}
		p2=p1;
		p1=(struct Student * )malloc(LEN);
		scanf("%s",p1->num);
	}
	p2->next=NULL;
	end=p2;
	return end;
}
void print(struct Student * end)
{
	struct Student * p;
	p=end;
	if(end!=NULL)
		do
		{
			printf("%s %s %c %d %s %s",p->num,p->name,p->sex,p->age,p->score,p->add);
			putchar('\n');
			p=p->pre;
		}
		while(p!=NULL);
}

int main()
{
	struct Student * p;
	p=creat();
	print(p);
	return 0;
}
struct stu
{
char data[100];
struct stu *next;
};
void main()
{
struct stu *head;
struct stu *p1,*p2;
p1=(struct stu *)malloc(LEN);
p1->next=NULL;
gets(p1->data);
while(strcmp(p1->data,"end"))
{
 p2=(struct stu *)malloc(LEN);
 p2->next=p1;
 p1=p2;
 gets(p1->data);
}
head=p1->next;
for(p2=head;p2;p2=p2->next)
puts(p2->data);
}
struct student
{
	char num[9];
	char name[20];
	char sex;
	int age;
	char grade[6];
	char add[11];
	struct student*next;
};
int n=0;
void main()
{
	struct student *head;
	struct student *p1,*p2,*temp,*p=NULL;
	p1=p2=(struct student*)malloc(LEN);
	scanf("%s",p1->num);
	scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->grade,p1->add);
	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);
		scanf("%s",p1->num);
		if(strcmp(p1->num,"end")==0)break;
	    scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,&p1->grade,p1->add);
	}
	p2->next=NULL;
	do
	{
		p2=NULL;
		p1=head;
		while(p1->next!=NULL)
		{
			p2=p1;
			p1=p1->next;
		}
		if(p==NULL)
		{
			p=p1;
			temp=p->next=p2;
		}
		temp=temp->next=p2;
		p2->next=NULL;
	}while(head->next!=NULL);
	do{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->grade,p->add);
		p=p->next;
	}while(p!=NULL);
}
struct student
{
	char info[100];
	struct student *next;
};
int n;
struct student *creat(void)
{
  struct student *head;
  struct student *p1,*p2;
  n=0;
  p1=p2=(struct student *)malloc(LEN);
  gets (p1->info);
  head=NULL;
  while (strcmp(p1->info,"end")!=0)
  {
  	n=n+1;
  	if (n==1) head=p1;
  	else p2->next=p1;
  	p2=p1;
  	p1=(struct student*)malloc(LEN);
  	gets (p1->info);
  }	
  p2->next=NULL;
  return (head);
}
void pri(struct student *head,int i)
{
	int j;
	struct student *p1,*p2;
	p1=head;
	for (j=1;j<i;j++)
	{
	   p2=p1;
	   p1=p2->next;
	}
	puts (p1->info);
}

void main()
{
	int i;
	struct student *head,stu;
	head=creat ();
	for (i=n;i>0;i--)
	pri(head,i);
}
struct student
{
	char str[500];
	struct student *next;
	struct student *before;
};
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	p1=p2=(struct student*)malloc(LEN);
	gets(p1->str);
	p1->before=NULL;
	head=p1;
	while(strcmp(p1->str,"end")!=0){
		p2=p1;
		p1=(struct student*)malloc(LEN);
		gets(p1->str);
		p2->next=p1;
		p1->before=p2;
	}
	p2->next=NULL;
	head=p2;
	return(head);
}

void main()
{
	struct student *p,*head;	
	head=creat();
	p=head;
	while(p->before!=NULL)
	{printf("%s\n",p->str);
	p=p->before;
	}
	printf("%s",p->str);
}
void main()
{
	int i=0, n=0;
	char a[500][100];
	for(i=0; i<500; i++)
	{
		gets(a[i]);
		//getchar();
		if(a[i][0]=='e') break;
	}
	n=i-1;
	for(i=n; i>=0; i--)
	{
		printf("%s\n",a[i]);
	}
}
struct student
{
	char num[10];
	char name[20];
	char s;
	int age;
	char score[20];
	char address[30];
	struct student *next;
};
int main()
{
	struct student *p1,*p2;
	p1=(struct student *)malloc(LEN);
	p1->next=0;
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->s,&p1->age,&p1->score,p1->address);
    while(1)
	{
		p2=p1;
		p1=(struct student *)malloc(LEN);
		p1->next=p2;
        scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->s,&p1->age,&p1->score,p1->address);
		if(p1->num[0]==	'e')
			break;
	}
     while(p1->next!=0)
	 {
		p1=p1->next;
		printf("%s %s %c %d %s %s\n",p1->num,p1->name,p1->s,p1->age,p1->score,p1->address);
	}
	 return 0;
}
void main()
{
	struct student
	{
		char num[10],name[20],sex,add[15];
		int age;
		float mark;
		struct student * next;
		struct student * before;
	};
	struct student *s1=(struct student *)malloc(sizeof(struct student)),*head=s1,*s2;
	(*s1).before=0;
	while(1)
	{
		scanf("%s",(*s1).num);
		if((*s1).num[0]!='e')
		{
			scanf("%s %c %d %f %s",(*s1).name,&((*s1).sex),&((*s1).age),&((*s1).mark),(*s1).add);
			s2=(*s1).next=(struct student *)malloc(sizeof(struct student));
			(*s2).before=s1;
			s1=s2;
		}
		else
		{
			head=(*s1).before;
			break;
		}
	}
	s1=head;
	while(1)
	{
		printf("%s %s %c %d %g %s\n",(*s1).num,(*s1).name,(*s1).sex,(*s1).age,(*s1).mark,(*s1).add);
		if((*s1).before)s1=(*s1).before;
		else break;
	}
}
struct student
{
	char num[100];
	char nam[100];
	char sex[2];
	char age[100];
	char sco[100];
	char add[100];
	struct student *prev;
	struct student *next;
};

struct student *create(void)
{
	struct student *head,*end,*p1,*p2;
	int n=0;
	p1=p2=(struct student*)malloc(LEN);
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0)
	{
		n++;
		scanf("%s%s%s%s%s",p1->nam,p1->sex,p1->age,p1->sco,p1->add);
		if(n==1)
		{
			head=p1;
			p1->prev=NULL;
		}
		else
		{
			p2->next=p1;           
			p1->prev=p2;
		}
		p2=p1;
		p1=(struct student*)malloc(LEN);
		scanf("%s",p1->num);
	}
	p2->next=NULL;                  
	end=p2;
	return(end);
}

void print(struct student *end)
{
	struct student *p;
	p=end;
	do
	{
		printf("%s %s %s %s %s %s\n",p->num,p->nam,p->sex,p->age,p->sco,p->add);
		p=p->prev;
	}while(p!=NULL);
}

void main()
{
	struct student *end;
	end=create();
	print(end);
}
struct Student
{
	char num[10];
	char name[25];
	char sex;
	int age;
	float score;
	char add[15];
	struct Student *next;
};
int main()
{
	struct Student *creat(void);
	struct Student *head,*p;
	head=creat();
	p=head;
	while(p->next!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
		p=p->next;
	}
	printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
}
struct Student *creat(void)
{
	struct Student *head,*news;
	int i;
	head=NULL;
	for(i=0;;i++)
	{
		news=(struct Student *)malloc(sizeof(struct Student));
		scanf("%s",news->num);
		if(news->num[0]=='e') break;
	    scanf(" %s %c %d %f %s",news->name,&news->sex,&news->age,&news->score,news->add);
		news->next=head;
	    head=news;
	}
	return(head);
}
struct student
{
	char num[200];
	char name[200];
	char sex;
	int age;
	float score;
	char address[200];
	struct student *next;
};
int num;
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	head=NULL;
	num=0;
	while(1)
	{
		p1=(struct student *)malloc(LEN);
		scanf("%s",p1->num);
		if (strcmp(p1->num,"end")==0)
		{
			p2->next=NULL;
			return (head);
			break;
		}
		else
		{
			scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->address);
			if (num==0)
				head=p1;
			else
				p2->next=p1;
			p2=p1;
			num++;
		}
	}
}
int main()
{
	struct student *pt,*p,*pre;
	int i;
	pt=creat();
	for (i=1;i<=num;i++)
	{
		for (p=pre=pt;p;p=p->next)
		{
			if (p->next!=NULL)
				pre=p;
			else
			{
				printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->address);
				pre->next=NULL;
			}
		}
	}
	return 0;
}
struct Student
{
    char num[41];
    char name[41];
    char gender[5];
    int age;
    char score[10];
    char address[41];
    struct  Student * next;
    struct  Student * pre;
};
int size=sizeof(struct Student);
struct Student gan;
void push ()
{
    char ster[41];struct Student * pt;
    scanf("%s",ster); 
    while(strcmp(ster,"end")!=0)
    {
        pt=malloc(size);
        strcpy(pt->num,ster);
        scanf("%s %s %d %s %s",pt->name,pt->gender,&pt->age,pt->score,pt->address);
        (gan.pre)->next=pt;//????????????next? 
        pt->pre=gan.pre;//????????????pre? 
        gan.pre=pt;//?????????????? 
        pt->next=&gan;//??????? 
        scanf("%s",ster);
    }
}
void display(struct Student stu)
{
    printf("%s %s %s %d %s %s\n",stu.num,stu.name,stu.gender,stu.age,stu.score,stu.address);
}
int main()
{
    gan.next=&gan;
    gan.pre=&gan;
    push();
    struct  Student * pt;
    pt=gan.pre;
    while(pt!=&gan)
    {
        display(*pt);
        pt=pt->pre;
    }
    return 0;
}
struct student
{char num[20];
 char name[20];
 char sex;
 int age;
 char score[20];
 char addr[30];
 struct student *next;
};
int n;

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

void main()
{
	struct student *p,*end;
	end=creat();
	p=end;
	if(end!=NULL)
	{
		do
		{
			printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->addr);
			p=p->next;
		}
		while(p!=NULL);
	}
}
struct num
{
	char content[50];
	struct num *next;
};

struct num *crea()
{
	long i;
	struct num *head;
	struct num *p1,*p2;
	p1=p2=(struct num *)malloc(LEN);
	head=p1;
	gets(p1->content);
	head->next=NULL;
	for(;;)
    { 
		p1=(struct num *)malloc(LEN);
		gets(p1->content);
		if(p1->content[0]!='e')
		{
			p1->next=p2;
			p2=p1;
		}
		else  {p1->next=p2,p2=p1;break;}
	}
   return(p1);
}
int main()
{
long nx,m,m0,tx,qx,q,mxh;
struct num *hi,*p,*t;
hi=crea();
t=hi->next;
for(p=t;p!=NULL;p=p->next)
printf("%s\n",p->content);
return 0;
}
struct student
{
	char seq[10];
	char other[100];
	struct student *next;
	struct student *previous;
};

void main()
{
	struct student *p1,*p2;
	int n=1;

	p1=p2=(struct student *)malloc(LEN);

	while(n++)
	{
		scanf("%s",p1->seq);
		if (strcmp(p1->seq,"end")==0) break;
		gets(p1->other);
		if (n>1) p1->previous=p2;
		p2=p1;
		p2->next=p1= (struct student *)malloc(LEN);
		
	}

	p1=p2;
	n=n-1;
	for (n;n>1;n--)
	{
		printf("%s%s\n",p1->seq,p1->other);
		p1=p1->previous;
	}
}
struct node
{
char data[10][20];
struct node *pre;
};
int main ()
{
int i,j;
struct node *p1,*p2;
p1=(struct node *)malloc(sizeof(struct node));
for (i=1;i<=6;i++)
cin>>(*p1).data[i];
p1->pre=NULL;
while((*p1).data[1][0]!='e')
{
p2=(struct node *)malloc(sizeof(struct node));
p2->pre=p1;
for (i=1;i<=6;i++)
cin>>(*p2).data[i];
p1=p2;
}
p1=p1->pre;
while(p1->pre)
{
for (i=1;i<=5;i++)
cout<<(*p1).data[i]<<' ';
cout<<(*p1).data[6]<<endl;
p1=p1->pre;
}
for (i=1;i<=5;i++)
cout<<(*p1).data[i]<<' ';
cout<<(*p1).data[6];
}