semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char score[50];
	char add[20];
	struct student *before;
};

struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	p1=(struct student* )malloc(len);
	p1->before=NULL;
	p2=p1;
	do
	{
		scanf("%s",p1->num);
		if(p1->num[0]=='e')
		{
			head=p2;
			free(p1);
	        return(head);
		}
		else
		{
			scanf("%s %c %d %s",p1->name,&p1->sex,&p1->age,p1->score);
		    scanf("%s",p1->add);
			p2=p1;
			p1=(struct student*)malloc(len);
			p1->before=p2;
		}
	}
	while(1);
}
void main()
{
	struct student *head1=creat();
	struct student *q=head1;
	while(q!=NULL)
	{	printf("%s %s %c %d %s %s\n",q->num,q->name,q->sex,q->age,q->score,q->add);
	    q=q->before;
	}
}
int n;
struct student
{
	char a[30];
	char name[20];
	char sex[20];
	char age[20];
	char score[20];
	char addr[30];
	struct student *next;
}

 *creat(void)
{ 
	struct student *head;
	struct student *p1,*p2;
    n=0;
	p1=p2=(struct student*) malloc(len);
	scanf("%s%s%s%s%s%s",p1->a,p1->name,p1->sex,p1->age,p1->score,p1->addr);
	head=NULL;
	while(strcmp(p1->a,"end")!=0)
	{  n++;
	   if (n==1) p1->next=NULL;
	   else 
	   p1->next=p2;
	   head=p1;
	   p2=p1;
	   p1=(struct student*)malloc(len);
	   scanf("%s%s%s%s%s%s",p1->a,p1->name,p1->sex,p1->age,p1->score,p1->addr);
	}
	return(head);
}
void print(struct student*head)
{
	struct student *p1;
	p1=head;
	if(head!=NULL)
		 do
		 {
			 printf("%s %s %s %s %s %s\n",p1->a,p1->name,p1->sex,p1->age,p1->score,p1->addr);
			 p1=p1->next;
		 }while(p1!=NULL);
}
main()
{
	struct student *head;
	head=creat();
	print(head);
}
struct student 
{
	char number[20];
	char name[20];
	char sex;
	int age;
	float grade;
	char address[20];
	struct student *next;
};
int n;
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	head=p1=p2=(struct student *)malloc(LEN);
	scanf("%s %s %c %d %f %s",p1->number,p1->name,&p1->sex,&p1->age,&p1->grade,p1->address);
    p2->next=NULL;
	for(n=0;;n++)
	{
		p1=(struct student *)malloc(LEN);
		p1->next=p2;
		scanf("%s",p1->number);
		if(strcmp(p1->number,"end")==0)break;
		scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->grade,p1->address);
		p2=p1;
		head=p1;
	}return head;
}
void main()
{
	struct student *head,*p;
	head=creat();
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->number,p->name,p->sex,p->age,p->grade,p->address);
		p=p->next;
	}
}
struct student
{
       char information[50];
       struct student *next;
};

int main()
{
    struct student *create_and_reverse();
    void print(struct student *head);
    struct student *head;
    head=create_and_reverse();
    print(head);
    return 0;
}

struct student *create_and_reverse()
{
       struct student *p1,*p2,*head;
       char end[50]={'e','n','d'};
       p1=(struct student *)malloc(len);
       p2=p1;
       
       gets((p1->information));
       for(;;)
       {
              p1=(struct student *)malloc(len);
              gets((p1->information));
              if(strcmp(p1->information,end))
              {
                                             (p1->next)=p2;
              }
              else
              {
                  head=p2;
                  break;
              }
              p2=p1;
       }
       return (head);
}

void print(struct student *head)
{
     struct student *p;
     p=head;
     for(;;)
     {
                           printf("%s\n",p->information);
                           if((p->next)==NULL)
                           {
                                              break;
                           }
                           else
                           {
                               p=(p->next);
                           }
     }
}
int n=0;
struct student
{
	char num[20];
	char name[20];
	char sex;
	char age[20];
	char score[20];
	char ad[20];
	struct student *next;
};
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	p1=p2=(struct student *)malloc(LEN);
	head=NULL;
	scanf("%s ",p1->num);
	if(p1->num[0]=='e')
		return(head);
	scanf("%s %c %s %s %s",p1->name,&p1->sex,p1->age,p1->score,p1->ad);
	p1->next=NULL;
	for(;;)
	{
		n=n+1;
		head=p1;
		if(n>1)
			p1->next=p2;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		scanf("%s",p1->num);
		if(strcmp(p1->num,"end")==0)
		{
			p1=NULL;
			break;
		}
		scanf("%s %c %s %s %s",p1->name,&p1->sex,p1->age,p1->score,p1->ad);
	}
	return(head);
}
void print(struct student *head)
{
	struct student *p;
	p=head;
	if(head!=NULL)
		do
		{
			printf("%s %s %c %s %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->ad);
			p=p->next;
		}while(p!=NULL);
}
void main()
{
	struct student *head;
	head=creat();
	print(head);
}
struct student
{
	char num[12];
	char name[25];
	char sex;
	int age;
	char score[6];
	char add[12];
}stu[max];
int main()
{
	int i,n,j;
	for(i=0;;i++)
	{
		scanf("%s",stu[i].num);
		if(stu[i].num[0]=='e')
		{
			break;
		}
		else
		scanf("%s %c %d %s %s",stu[i].name,&stu[i].sex,&stu[i].age,stu[i].score,stu[i].add);
	}
	if(i==0)
		printf("\n");
	else
	{
	for(j=i-1;j>=0;j--)
		printf("%s %s %c %d %s %s\n",stu[j].num,stu[j].name,stu[j].sex,stu[j].age,stu[j].score,stu[j].add);
	}
	return 0;
}
struct student
{
	char info[100];
	struct student *next;
	struct student *former;
};
int main()
{
	struct student *head,*tail,*p;
	char s[100];
	p=(struct student*)malloc(sizeof(struct student));
	gets(p->info);
	head=p;
	head->former=NULL;
	tail=p;
	while (strcmp(p->info,"end")!=0)
	{
		p=(struct student*)malloc(sizeof(struct student));
		gets(p->info);
		tail->next=p;
		p->former=tail;
		tail=p;
	}
	while (p->former!=NULL)
	{
		p=p->former;
		printf("%s\n",p->info);
	}
	return 0;
}
int l;

struct students
{
    char num[10];
	char name[20];
    char sex;
	int age;
	float score;
	char addr[100];
	struct students *next;
};

struct students *ann()
{
	struct students *head=NULL,*newnode,*p;
	int i;
    for(i=0;;i++)
	{
        newnode=(struct students *)malloc(sizeof(struct students));

		scanf("%s",newnode->num);
		if(newnode->num[0]=='e')
		{
			l=i;
            head=p;
			break;
		}
		scanf("%s %c %d %f %s",newnode->name,&newnode->sex,&newnode->age,&newnode->score,newnode->addr);
		if(i==0)
		{
			newnode->next=NULL;
			p=newnode;
		}
		else
		{
			newnode->next=p;
            p=newnode;
		}
	}
	return(head);
}


void main()
{
	int i;
	struct students *p;
	p=ann();
	for(i=0;i<l;i++)
	{
        printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->addr);
		p=p->next;
	}
  
}
struct student
{
	char str[100];
	struct student *next;
};
int n;
struct student *creat(void)
{
	struct student *head;
	struct student *p1,*p2;
	p1=p2=(struct student *)malloc(LEN);
	gets(p1->str);
	p1->next=NULL;
	p2=p1;
	while(strcmp(p2->str,"end")!=0)
	{
		n=n+1;
		if(n==1)head=p1;
		else {head=p2;p1=p2;}
		p2=(struct student *)malloc(LEN);
		p2->next=p1;
		gets(p2->str);
	}
	return(head);
}
void print(struct student *head)
{
	struct student *p;
	p=head;
	if(head!=NULL)
		while(p->next!=NULL)
		{
			puts(p->str);
			p=p->next;
		}
		puts(p->str);
}
void main()
{
	struct student *ip;
	ip=creat();
	print(ip);
}
char m[]="end";
struct student
{
 char studen[100];
 struct student *next;
};
 int n;
 struct student *creat(void)
 {
	 struct student *head,*p1,*p2;
	 n=0;
	 p1=p2=(struct student *)malloc(sizeof(struct student));
	 gets(p1->studen);
	 head=NULL;
	 while(strcmp(p1->studen,m)!=0)
	 {
      n=n+1;
	  if(n==1)head=p1;
	  else p2->next=p1;
	  p2=p1;
	  p1=(struct student *)malloc(sizeof(struct student));
	  gets(p1->studen);
	 }
	 p2->next=NULL;
	 return(head);
 }
 void print(struct student *head)
{
	 struct student *p,*q;
      p=q=head;/*p,q???????????*/
	  while(p->next!=NULL) 
      p=p->next;/*?p??????????????*/
    printf("%s\n",p->studen);
   while(1) 
   { 
   while(q->next!=p) 
     q=q->next;
     printf("%s\n",q->studen);
    p=q;
    q=head;
   if(p==head)
	   break; 
   }
 }
int main()
{   struct student *ahead;
	ahead=creat();
    print(ahead);
}
struct student
{
	char num[10];
	char name[20];
	char sex;
	int age;
	float score;
	char adr[15];
	struct student *last;
};

char str[]="end";
int n=0;

void print(struct student *head)
{
	struct student *p;
	p=head;
	if(head!=NULL)
		do
		{
			printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->adr);
		    p=p->last;
		}while(p!=NULL);
}

void main()
{
	struct student *creat(void);
	void print(struct student *head);
	struct student *head;
	head=creat();
	print(head);
}

struct student *creat()
{
	struct student *head;
	struct student *p1,*p2;
	p1=p2=(struct student*)malloc(LEN);
	scanf("%s",&p1->num);
	head=NULL;
	while(strcmp(p1->num,str)!=0)
	{
		scanf("%s %c %d %f %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->adr);
		if(n==0){p1->last=NULL;n=1;}
		else {p1->last=p2;}
		p2=p1;
		p1=(struct  student*)malloc(LEN);
		scanf("%s",&p1->num);
	}
	head=p2;
	return(head);
}
struct student
{
	char num[20],na[30],sex[2],sc[10],old[3],ad[20];

	struct student *next;
};
int n;
void main()
{
	struct student *head,*p1,*p2,*p;
	n=0;
	p1=p2=(struct student *)malloc(LEN);
	head=NULL;
	while(scanf("%s",p1->num),p1->num[0]!='e')
	{
        
		n=n+1;
		head=p1;
		if(n>1)
		   p1->next=p2;
		else
           p1->next=NULL;
		p2=p1;
        scanf("%s%s%s%s%s",p1->na,p1->sex,p1->old,p1->sc,p1->ad);
		p1=(struct student *)malloc(LEN);
		
	}
	
    p=head;
    while(p!=NULL)
	{ 
		printf("%s %s %s %s %s %s\n",p->num,p->na,p->sex,p->old,p->sc,p->ad);
        p=p->next;
	};
}
struct student
{
	char str[100];
    struct student *next;
	struct student *front;
};
struct student *create()
{
	struct student *head,*pf,*pa,*end;
	int n=1,flag=0;
	do
	{
		pa=(struct student *) malloc(LEN);
		gets(pa->str);
		if(strcmp(pa->str,"end")==0)
		{
			if(n==1) flag=1;
			break;
		}
		if(n==1)
		{
			head=pa;
			pf=pa;
			pa->front=NULL;
			n++;
		}
		else 
		{
			pf->next=pa;
			pa->front=pf;
			pf=pa;
		}
	 }while(n!=0);
	if(flag==0){pf->next=NULL;
	end=pf;}
	else{head=pa; end=NULL;}
    return(end);
}
int main()
{
	struct student *end,*pt;
	end=create();
	pt=end;
	while(pt!=NULL)
	{
		printf("%s\n",pt->str);
		pt=pt->front;
	}
	
	return 0;
}
struct student//?????????????????
{
	char num[100];
	char name[100];
	char gender;
	int age;
	float grade;
	char address[100];
	struct student *next;
} ;
struct student *p1,*p2;

struct student *creat()//????????
{
	int n;
	struct student *head;
	n=0;
	p1=p2=(struct student *)malloc(LEN);//???????*????????????????
	scanf("%s %s %c %d %f %s",p1->num,p1->name,&p1->gender,&p1->age,&p1->grade,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 student *)malloc(LEN);
		scanf("%s",p1->num);
        if(strcmp(p1->num,"end")!=0)
        scanf("%s %c %d %f %s\n",p1->name,&p1->gender,&p1->age,&p1->grade,p1->address);
	}
	p2->next=NULL;
	return(head);
}
void print(struct student *head)//????
{
	struct student *p1;
	for(p1=head; p1!=NULL; printf("%s %s %c %d %g %s\n",p1->num,p1->name,p1->gender,p1->age,p1->grade,p1->address),p1=p1->next);
}

//?????
struct student * turnback(struct student *head)
{
	struct student *new,*newhead=NULL;
	do
	{
		p2=NULL;
		p1=head;
		while(p1->next!=NULL){ p2=p1;p1=p1->next;}
		if(newhead==NULL) newhead=p1,new=newhead->next=p2;
		else new=new->next=p2;
		p2->next=NULL;
	}
	while(head->next!=NULL);
	return(newhead);
}
void main()
{
	struct student *head;
	head=creat();
	head=turnback(head);
	print(head);
}
struct stu
{
	char num[500];
	char name[500];
	char sex[2];
	char age[100];
	char score[100];
	char add[500];
	struct stu *next;
};
int n;
struct stu *tj(void)
{
	struct stu *head;
	struct stu *p1,*p2;
	
	n=0;
	p2=p1=(struct stu*)malloc(LEN);
	scanf("%s %s %s %s %s %s",&p1->num,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add);
	head=NULL;
	while(1)
	{
		n=n+1;
		if(n==1)
			head=p1;
		else
			p1->next=p2;
		p2=p1;
		p1=(struct stu*)malloc(LEN);
		scanf("%s",&p1->num);
		if(strcmp(p1->num,"end")==0)
			break;
		scanf("%s %s %s %s %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add);
	}
	head=p2;
	return(head);
}
void print(struct stu *head)
{
	struct stu *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->add);
		p=p->next;
	}
}
void main()
{
	struct stu *z;
	z=tj();
	print(z);
}
struct st /*????????????*/
{
	char id[20];
	char name[20];
	char sex[2];
	int age;
	char sco[20];
	char ad[20];
	struct st *next;
};

main()
{
	struct st *head,*p1,*p2,*p;
	p1 = p2 = (struct st*)malloc(len); /*???p1,p2?????????????*/
	scanf("%s%s%s%d%s%s",p1->id,p1->name,p1->sex,&p1->age,p1->sco,p1->ad);
	p2->next = null; /*????????????????????*/
	do /*??????*/
	{
		p1 = (struct st*)malloc(len); /*???????*/
		scanf("%s",p1->id); /*????????????id???*/
		if (strcmp(p1->id,"end") == 0) /*???end'???????*/
		{
			break;
		}
		scanf("%s%s%d%s%s",p1->name,p1->sex,&p1->age,p1->sco,p1->ad);
		p1->next = p2; /*????????????*/
		p2 = p1; /*?p2?????*/
	}
	while (1);
	head = p2; /*?????????????????????*/
	p = head;
	do /*???????????????????*/
	{
		printf("%s %s %s %d %s %s\n",p->id,p->name,p->sex,p->age,p->sco,p->ad);
		p = p->next; /*???????????*/
	}
	while(p != null);
	return 0;
}
struct student
{
       char name[100];
       struct student *next;
};

   
int main()
{
       struct student *head,*p1,*p2;int i=0,j=0,m=0,k=0,n;
       p1=(struct student *)malloc(Len);
       scanf("%s",p1->name);
       p1->next=NULL;head=p1;
       for(;strcmp(p1->name,"end")!=0;i++)
       {
           p2=p1;
           p1=(struct student*)malloc(Len);
           scanf("%s",p1->name);
           p1->next=NULL;
           p2->next=p1;
           p2=p1;
       }
     struct student *p; p=head; j=0;n=i/6;
     for(m=1;m<=n;m++)
     {   p=head;j=0;
    
         while(p&&j!=i-6*m)
         {
            p=p->next;
            j++;
         }
        
         if(p&&(j==i-6*m))
         {     
                for(k=0;k<5;k++)
               {
               printf("%s ",p->name);p=p->next;
               }
               printf("%s",p->name);
         }
        printf("\n");
     }
     }
void main()
{
	
	struct st
	{
		char num[500];
		char name[500];
		char sex;
		int age;
		double mark;
		char adress[500];
		struct st *next;
	}*p,*p1,*p2;
	p2=NULL;
	
	while(1)
	{   p1=(struct st*)malloc(sizeof(struct st));p1->next=p2;p2=p1;
		scanf("%s",p1->num);if(strcmp("end",p1->num)==0){p=p1->next;break;}
		scanf("%s %c %d %lf %s",p1->name,&p1->sex,&p1->age,&p1->mark,p1->adress);
		
	}
	
	while(p!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->mark,p->adress);
		p=p->next;
	}
}
struct student
{
char num[20];
char name[40];
char sex[10];
int age;
char score[20];
char addr[100];
struct student *next;
};
main()
{
struct student *head,*p1,*p;
int n=0;
p1=( struct student*) malloc(LEN);
scanf("%s%s%s%d%s%s",p1->num,p1->name,p1->sex,&p1->age,p1->score,p1->addr);
head=NULL;
while(strcmp(p1->num,"end")!=0)
{
n=n+1;
if(n==1) {head=p1;p1->next=NULL;}
else {p1->next=head;head=p1;}
p1=(struct student*)malloc(LEN);
scanf("%s%s%s%d%s%s",p1->num,p1->name,p1->sex,&p1->age,p1->score,p1->addr);
}
p=head;
do
{
printf("%s %s %s %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->addr);
p=p->next;
} while(p!=NULL);
}
struct stu
{
	char num[9];
	char name[18];
	char sex[2];
	int age;
	float score;
	char addr[12];
	struct stu *pre;
};

struct stu *create()
{
	struct stu *head,*p1,*p2;
	char end[]={"end"};
	p1=(struct stu *)malloc(LEN);
	scanf("%s",p1->num);
	if(strcmp(p1->num,end)==0)
	{
		return p1;
	}
	scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->addr);
	p1->pre=NULL;
	p2=p1;
	while(1)
	{
		p1=(struct stu *)malloc(LEN);
		scanf("%s",p1->num);
		if(strcmp(p1->num,end)==0)
		{
			return p2;
		}
		scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->age,&p1->score,p1->addr);
		p1->pre=p2;
		p2=p1;
	}
}

void print(struct stu *head)
{
	struct stu *p1;
	p1=head;
	while(p1)
	{
		printf("%s %s %s %d %g %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->addr);
		p1=p1->pre;
	}
}

void destroy(struct stu *head)
{
	struct stu *p1;
	while(head)
	{
		p1=head;
		head=p1->pre;
		free(p1);
	}
}

int main()
{
	struct stu *head;
	head=create();
	print(head);
	destroy(head);
	return 0;
}
struct student 
{
	char ID[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char address[20];
	struct student *next;
	struct student *before;
};
struct student *create()
{
	struct student *head,*p1,*p2,*end;
	p1=(struct student*)malloc(LEN);
	scanf("%s",p1->ID);
	if(strcmp(p1->ID,"end")==0){free(p1);head=NULL;end=NULL;}
	else
	{
		head=p1;
		scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
		p1->next=NULL;
		p1->before=NULL;
		p2=p1;
		
	do
	{
		p1=(struct student*)malloc(LEN);
		p1->before=p2;
		p1->next=NULL;
		scanf("%s",p1->ID);
		if(strcmp(p1->ID,"end")==0){p2->next=NULL;end=p2;free(p1);break;}
		else
		{
			scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
			p2->next=p1;
			p1->before=p2;
			p1->next=NULL;
			p2=p1;
		}
	}while(1);
	}
	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->before;
	}

}
int main()
{
	
	struct student *end;
	end=create();
	print(end);
}
struct student 
{
     char number[30];
     char name[20];
     char sex;
     int age;
     char score[30];       
     char address[20]; 
     struct student *next; 
};
main()
{
     struct student *head,*end,*p,*q,*a;
     head=(struct student*)malloc(sizeof(struct student));
     end=(struct student*)malloc(sizeof(struct student));
     int i,n;
     end->next=NULL;
     a=head;
     for(i=1;;i++)
     {
         if(i==1)
         {
             p=(struct student*)malloc(sizeof(struct student)); 
             scanf("%s",p->number);
             if(p->number[0]=='e') break;   
             scanf("%s %c %d %s %s",p->name,&p->sex,&p->age,p->score,p->address);
             head->next=p; 
             p->next=end;
             q=p;
         }
         else
         {
             p=(struct student*)malloc(sizeof(struct student)); 
             scanf("%s",p->number);   
             if(p->number[0]=='e') break;   
             scanf("%s %c %d %s %s",p->name,&p->sex,&p->age,p->score,p->address);
             head->next=p; 
             p->next=q;
             q=p;       
         }
     }
     a=head->next;
     for(;a->next!=NULL;)                                
     {
         printf("%s %s %c %d %s %s\n",a->number,a->name,a->sex,a->age,a->score,a->address);
         a=a->next;                                                 
     }  
      
}
struct student
{
	char id[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char addr[20];
	struct student *next;
};
int n;
struct student *head;
struct student *creat(void)
{
	struct student *p1,*p2;
	n=0;
	p1=p2=(struct student *)malloc(LEN);
	scanf("%s",p1->id);
	head=NULL;
	while(strcmp(p1->id,"end")!=0)
	{
		scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->addr);
		n=n+1;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct student *)malloc(LEN);
		scanf("%s",p1->id);
	}
	p2->next=NULL;
	return(head);
}
void main()
{
	head=creat();
    struct student *p,*p0;
	p=(struct student *)malloc(100*LEN);
	p0=(struct student *)malloc(LEN);
	p0=head;
	int i;
	for(i=0;i<n;i++,p++)
	{
		*p=*p0;
		p0=p0->next;
	}
	p--;
	printf("%s %s %c %d %s %s",&p->id,&p->name,p->sex,p->age,&p->score,&p->addr);
	p--;
	for(i=1;i<n;i++,p--)
		printf("\n%s %s %c %d %s %s",&p->id,&p->name,p->sex,p->age,&p->score,&p->addr);
}
struct student
{
	struct student *pre;
	char num[100];
	char name[20];
	char sex[2];
	char age[10];
	char score[10];
	char ad[100];
};
void main()
{
	int n=0;
	struct student *end,*p1,*p2,*p;
	p1=(struct student *)malloc(LEN);
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0)
	{
		scanf("%s %s %s %s %s",p1->name,p1->sex,p1->age,p1->score,p1->ad);
		n=n+1;
		if(n==1)
			p1->pre=NULL;
		else
			p1->pre=p2;
			p2=p1;
			p1=(struct student *)malloc(LEN);
			scanf("%s",p1->num);
	}
	p=p2;
	do
	{
		printf("%s %s %s %s %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->ad);
		p=p->pre;
	}while(p!=NULL);

}
struct a
{
struct a*back;
char a[20];
char b[20];
char c;
int d;
char e[20];
char f[20];
struct a*next;      
};
int main()
{
    struct a *pHeader,*pEnd,*p1;
    pHeader=(struct a*)malloc(sizeof(struct a));
    pHeader->back=NULL;
    p1=pHeader;
    struct a*p;
    char g;
    for(;;)
    {
    p=(struct a*)malloc(sizeof(struct a));
    scanf("%s",p->a);
    g=*p->a;
    if(g=='e') 
    {
    pEnd=p;
    p->back=p1;
    p1->next=p;
    p->next=NULL; 
    break;
    }
    p->back=p1;
    p1->next=p;
    p1=p;
    scanf("%s %c %d %s %s",p->b,&p->c,&p->d,&p->e,p->f);
    }
    printf("%s %s %c %d %s %s\n",p1->a,p1->b,p1->c,p1->d,p1->e,p1->f); 
    p=pEnd;       
    for(;;)
    {
    printf("%s %s %c %d %s %s\n",p1->back->a,p1->back->b,p1->back->c,p1->back->d,p1->back->e,p1->back->f); 
   p1=p1->back;
   free(p1->next);
    
    if(p1->back->back==NULL) break;
    }

}
struct student
{
	char num[20];
	char name[20];
	char sex[20];
	char age[20];
	char score[20];
	char add[20];
	struct student *next;
};
int n;

void main()
{
	int i;
	struct student *head,*p1,*p2,*newhead,*new;
	n=0;
	p1=p2=(struct student *)malloc(LEN);
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0)//built link;
	{
		scanf("%s%s%s%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);
	}
	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 %s %s %s %s %s",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->add);
		p1=p1->next;
		printf("\n");
	}
	
}
struct student
{
	char inf[1000];
	struct student *pre,*next;
};
void main()
{
	struct student *head,*p1,*p2,*tail;
	int i,j,k;
	head=(struct student *)malloc(LEN);
	p1=head;p2=NULL;
	p1->pre=NULL;p1->next=NULL;
	for(;;)
	{
		gets(p1->inf);
		if (strcmp(p1->inf,"end")==0) {p1->pre=p2;tail=p2;break;}
		else 
		{
			p1->pre=p2;
			p1->next=(struct student *)malloc(LEN);
			p2=p1;p1=p1->next;p1->next=NULL;
		}
	}
	p1=tail;
	while (p1)
	{
		puts(p1->inf);
		p1=p1->pre;
	}
}
struct node{
	char str[MAX];
	struct node *next;
}*head;

void main()
{
	struct node *p1,*p2,*p;
	p1=p2=(struct node *)malloc(LEN);
	gets(p1->str);
	p1->next=0;
	while(strcmp( p1->str , "end" )!=0){
		p1=(struct node *)malloc(LEN);
		gets(p1->str);
		p1->next=p2;
		head=p2;
		p2=p1;
	}

	p=head;
	while(p!=0){
		puts(p->str);
		p=p->next;
	}
}
int main()
{
    struct student
    {
        char num[20];
        char name[20];
        char sex;
        int age;
        float mark;
        char address[20];
        struct student *next;
        struct student *pre;
    };
    struct student *stu;
    stu=(struct student*)malloc(LEN);
    stu->pre=NULL;
    while (1)
    {
        scanf ("%s",stu->num);
        if (strcmp(stu->num,"end")==0)
        break;
        scanf ("%s %c %d %f %s",stu->name,&stu->sex,&stu->age,&stu->mark,stu->address); 
        stu->next=(struct student*)malloc(LEN);
        stu->next->pre=stu;
        stu=stu->next;
    }
    stu=stu->pre;
    free(stu->next);
    for ( ;stu!=NULL; )
    {
        printf("%s %s %c %d %g %s\n",stu->num,stu->name,stu->sex,stu->age,stu->mark,stu->address);
        stu=stu->pre;
        if (stu!=NULL)
        free (stu->next);
    }
    return 0;
}