label
stringlengths
1
2
index
stringlengths
1
5
code
stringlengths
87
8.24k
31
15100
struct Student { char inf[81]; struct Student *front,*next; }; int n; struct Student *creat() { struct Student *head,*p1,*p2,*temp; n=0; p1=p2=(struct Student *)malloc(LEN); gets(p1->inf); head=NULL; while(strcmp(p1->inf,"end")!=0) { n++; if(n==1) { head=p1;p1->front=NULL; } else { p2->next=...
31
15101
struct student { char number[10]; char name[100]; char sex; int age; char score[20]; char add[20]; struct student *pre; }; int n; struct student *creat(void) { struct student *tail; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(sizeof(struct student)); scanf("%s %s %c %d %s %...
31
15102
struct student { struct student *last; char a[100]; }; int main () { // freopen ( "1.in" , "r" , stdin ); // freopen ( "1.out" , "w" , stdout ); char a[100]; struct student *p , *p1; p = p1 = ( struct student * ) malloc ( sizeof ( struct student ) ); p1->last = NULL; gets ( p1->a ); fo...
31
15103
struct stu { char info[1000]; struct stu * next; }; struct stu * head; struct stu * create() { char str1[]="end"; struct stu *p1,*p2,*p; p1=(struct stu*)malloc(Len); gets(p1->info); p1->next=NULL; if(strcmp(p1->info,str1)==0) { free(p1); head=NULL; return head; } else { head=p1; p2=p1; do{ ...
31
15104
struct stu { char xuehao[20]; char name[20]; char sex[10]; int old; float score; char where[20]; struct stu *next; }; void main() { struct stu *head,*p0,*p; int i; char a[4]="end\0"; head=NULL; for(i=0;;i++) { p0=(struct stu*)malloc(LEN); scanf("%s",p0->xuehao); if(strcmp(p0->xuehao,a)==0) break; ...
31
15105
//#include <memory.h> struct information {char info[50]; struct information*next; }; struct information* creat() {struct information *head,*p1,*p2; p1=p2=(struct information*)malloc(len); p1->next=NULL; gets(p1->info); while(strcmp(p1->info,"end")!=0) {p2=p1; p1=(struct information*)malloc(len); gets(p1->...
31
15106
void main() { int i,j,k,m,n; struct stu { char xh[100]; char xm[100]; char xb; int nl; float df; char dz[100]; struct stu *af; struct stu *bf; }; struct stu *p1,*p2,*head; head=p2=p1=(struct stu *)malloc(sizeof(struct stu)); scanf("%s %s %c %d %f %s",p1->xh,p1->xm,&p1->xb,&p1->nl,&p1->df,p1->dz);...
31
15107
void main() { struct student { char info[1000]; struct student *pre,*next; } *head,*tail,*p; int l; l=sizeof(struct student); head=(struct student*)malloc(l); p=head; p->pre=NULL; p->next=NULL; for (;;) { gets(p->info); if (strcmp(p->info,"end")==0) {tail=p;break;} p->next=(struct student*)malloc(l...
31
15108
struct student { char number[40]; char name[50]; char sex; int age; float score; char address[50]; struct student *next; }; int n; struct student *creat(void) { struct student *head,*p1,*p2; p1=p2=(struct student*)malloc(Len); head=NULL; scanf("%s%s %c%d%f%s",p1->number,p1->name,&(p1->sex),&(p1->age),&(p1->s...
31
15109
//#include<stdlib.h>// struct student { struct student *bef; char n[10]; char s[20]; char sex; int age; char score[10]; char address[20]; struct student *next; }; int n; struct student *creat(void) { struct student *p1,*p2; n=0; ...
31
15110
typedef struct linknode { char inf[500]; struct linknode *next,*prev; } snode,*ptr; main () { int i,a1,a2,j,min,k; ptr head,p1,p2,p3; k=0; for (i=1;i<=5;i) { p1=(ptr)malloc(sizeof(snode)); if (k==0) {head=p1; p2=p1;} else {(*p2).next =p1; (*p1).prev=p2;} ...
31
15111
struct list{ char no[10]; char name[20]; char gene; unsigned int age; float score; char add[20]; struct list *next; }; struct list *creat() { struct list *p1=NULL,*p2=NULL,*head; int n=0; do{ p2=p1; p1=(struct list*)malloc(sizeof(struct list)); scanf("%s",p1->no); if(*p1->no=='e') { ...
31
15112
void main() { struct fy { char xh[100]; char xm[100]; char xb; int nl; float df; char dz[100]; struct fy *pre; }; struct fy *p,*node; int n=1; for(;;) { node= (struct fy *)malloc(sizeof(struct fy)); if(n==1) node->pre=NULL; else node->pre=p; scanf("%s",node->xh); if(strcmp(node->xh,"end")==...
31
15113
struct student { char num[20]; char name[20]; char sex; int age; float score; char address[20]; struct student *next; }; int n; struct student *creat(void) { struct student *head; struct student *p1,*p2; int num=0; head=NULL; while (1) { p1=(struct student *)malloc(LEN); scanf("%s",p1->num); if (strc...
31
15114
struct student { char num[15]; char name[30]; char sex[2]; short age; float score; char address[30]; struct student *former; }; void main() { struct student *p1,*p2; p1=p2=(struct student *)malloc(LEN); scanf("%s%s%s%d%f%s",p1->num,p1->name,p1->sex,&p1->age,&p1->score,p1->address); p1->former=NUL...
31
15115
typedef struct Node{ char content[150];//??????????????????????????????) struct Node *next;//?????? struct Node *front; }node,*ptr; main() { char temp[150],std[4] = "end";//std??????? ptr head = NULL,p,q;//head??? while(1){ gets(temp); if(strcmp(temp,std) != 0){ p = (ptr)malloc(sizeof(node)); strcpy(p->...
31
15116
int main() { int m,n,i,s; char a[1000][100]; for(i=1;;i++) { gets(a[i]); if(strcmp(a[i],"end")==0) break; } for(s=i-1;s>0;s--) printf("%s\n",a[s]); return 0; }
31
15117
main() { char a[3000][50],end[5]="end";int i=-1; do { i++; gets(a[i]); } while(a[i][0]!='e'); i--; while(i>=0) { puts(a[i]); i--; } }
31
15118
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->n...
31
15119
struct student { char xuehao[10]; char xingming[20]; char xingbie; int nianling; float chengji; char dizhi[20]; struct student *next; }; struct student *creat() { int n=0; struct student *head,*p1,*p2; p1=p2=(struct student*)malloc(LEN); while(1) { scanf("%s",p1->xuehao); if(p1->xuehao[0]=='e') {head...
31
15120
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...
31
15121
//#define NULL 0 struct student { char num[20]; char name[20]; char sex; int age; char score[10]; char adress[20]; // struct student *next; struct student *before; }; struct student *creat(void) { struct student *head,*p1,*p2; int n; n=0; p1=p2=(struct student *)malloc(LEN); // scanf("%s %s %c %d %d %s",p1-...
31
15122
int i,n,m,t; struct stu { char num[1000]; struct stu *next; }; struct stu *creat(void) { struct stu *head; struct stu *p1,*p2; n=0; p1=p2=(struct stu *)malloc(len); gets(p1->num); while(strcmp(p1->num,"end")!=0) { n=n+1; if(n==1) head=p1; else p2->next=p1; p2=p1; p1=(struct stu *)malloc(len); get...
31
15123
struct student { char num[30]; char name[30]; char sex; int age; char score[20]; char add[30]; struct student *next; }; int main() { struct student *p,*p1; int n=0; p=(struct student *)malloc(LEN); scanf("%s %s %c %d %s %s",p->num,p->name,&p->sex,&p->age,p->score,p->add); //printf("%s %s %c %d %f %s\n",p->n...
31
15124
struct stu {char id[100]; char name[100]; char sex[3]; char age[10]; char score[10]; char add[100]; struct stu *next; }; int main() { int k,m,n,t,ans,ii,i,j,jj,flag; struct stu *p0,*p1,*p2,*head; char s[30]; p1 = (struct stu*)malloc(LEN); scanf("%s%s%s%s%s%s",p1->id,p1->name,p1->sex,&p1->age,&p1->score,...
31
15125
struct student { char number[100]; char name[100]; char sex; int age; char score[100]; char address[100]; struct student *prev; struct student *next; }; int main() { struct student *phead,*p,*q; char m[10]; phead=(struct student*)malloc(sizeof(struct student)); phead->pre...
31
15126
struct student { char str[100]; struct student *next; }; int n; char end[5]="end"; struct student *creat(void) { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(LEN); gets(p1->str); head=null; while(strcmp(p1->str,end)!=0) { n=n+1; if(n==1) head=p1; else p2->next...
31
15127
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')...
31
15128
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-...
31
15129
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,p...
31
15130
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 ...
31
15131
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...
31
15132
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); } ...
31
15133
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(sizeo...
31
15134
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",...
31
15135
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=(stru...
31
15136
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; ...
31
15137
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);...
31
15138
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 ...
31
15139
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=p...
31
15140
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);//???????*???????????????? sca...
31
15141
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,&p...
31
15142
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 = nu...
31
15143
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; ...
31
15144
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...
31
15145
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...
31
15146
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,...
31
15147
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=NUL...
31
15148
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...
31
15149
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) ...
31
15150
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,p...
31
15151
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(s...
31
15152
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 lin...
31
15153
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->...
31
15154
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...
31
15155
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; whil...
31
15156
struct st { char id[20]; char name[20]; char sex; int age; float goal; char address[20]; struct st *last; }; struct st *input(void) { int n; struct st *end,*p1,*p2; n=0; p1=p2=(struct st *)malloc(sizeof(struct st)); scanf("%s",p1->id); while(...
31
15157
struct stu { char xh[10]; char name[20]; char xb; int age; char score[20]; char add[20]; struct stu *next; }; struct stu *creat() { struct stu *head,*p1,*p2; int n=0; p1=p2=(struct stu *)malloc(sizeof (struct stu)); head=0; while(strcmp(p1->xh,"end")!=0) { n++; if(n==1) { p1->next...
31
15158
struct student {char a[88]; struct student *next; }; struct student *creat(void) {struct student *p1,*p2,*head; p1=p2=(struct student *)malloc(LEN); gets(p1->a); p1->next=0; while(strcmp(p1->a,"end")!=0) {p2=p1; p1=(struct student *)malloc(LEN); gets(p1->a); p1->next=p2; } head=p2; return(head); } void print(struct st...
31
15159
struct student { char num[10]; char name[20]; char sex; int age; char score[10]; char id[20]; struct student *pre; }; void main() { struct student *p1,*p2,*end; p1=(struct student *)malloc(sizeof(struct student)); end=p1; p2=p1; p1->pre=NULL; scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1-...
31
15160
struct student { struct student *next; char num[20]; char name[20]; char sex[2]; int age; float score; char address[40]; }; struct student *creat() { struct student *head,*p1,*p2; p1=(struct student *)malloc(LEN); scanf("%s",p1->num); if(strcmp(p1->num,"end")!=0) { scanf("%s%s%d%f%s",p1->name,p1->sex,&p1-...
31
15161
struct student //?????? { char num[10]; //?? char name[20]; //?? char sex[5]; //?? int age; //?? char score[20]; //?? char addr[20]; //?? struct student *next; }; struct student *head; //??????? struct student *input() //?????? { struct student *p1,*p2; p1=p2=(struct student *)malloc(sizeof(struct student)); ...
31
15162
struct stu { char num[100]; char name[100]; char sex[10]; int age; char score[100]; char add[100]; struct stu *before; }; void main() { struct stu *p2; struct stu * f(); p2=f(); while (p2!=0) { printf("%s %s %s %d %s %s\n",p2->num,p2->name,p2->sex,p2->age,p2->score,p2->add); p2=p2->before; }...
31
15163
struct student { char str[1000]; struct student *next; }; struct student *create(void) { struct student *head; struct student *p1,*p,*p2; head=p1=(struct student *)malloc(len); gets(p1->str); p1->next=0; p2=p1; while(strcmp(p1->str,"end")!=0) { p=head; head=p1; head->next=p; p1=(struct student *)mal...
31
15164
struct shuju { char xh[20]; char xm[20]; char sex; int age; char fen[10]; char dorm[20]; struct shuju * next; }; struct shuju *create() { struct shuju *head,*p1,*p2; p1=(struct shuju* )malloc(len); scanf("%s %s %c %d %s %s",p1->xh,p1->xm,&p1->sex,&p1->age,p1->fen,p1->dorm); ...
31
15165
struct student { char num[100]; struct student *pNext; }; int main() { int i,count=0; struct student a[1000],*pheader,*p; for(i=0;;i++) { gets(a[i].num); count++; if(strcmp(a[i].num,"end")==0) break; } pheader=&a[count-2]; for(i=count-2;i>=1;i--) ...
31
15166
struct student { char all[100]; struct student *next; }; main() { int k; int a=0; struct student *p; struct student *head; struct student *p1,*p2; p1=p2=(struct student *)malloc(n); head=NULL; k=0; for(k=0;;k++)...
31
15167
struct st { char id[10000]; struct st *next; }; int main() { struct st *head=NULL,*p=NULL,*q=NULL; char end; while (1) { p=(struct st*)malloc(sizeof(struct st)); if(p!=NULL) { gets(p->id); p->next=q; if (p->id[0]=='e') break; else q=p; } } p=p->next; while(1) { puts(p->id); ...
31
15168
main() { struct INF {char a1[20];char a2[20]; char a3[20];char a4[20];char a5[20]; char a6[20];struct INF *pp;} *p1,*p2; p1=(struct INF *)malloc(sizeof(struct INF)); p2=NULL; int n=0,i; scanf("%s",p1->a1); while (strcmp(p1->a1,"end")!=0) { scanf("%s",p1->a2); ...
31
15169
struct student { char num[100]; char name[30]; char sex; int age; float grade; char adress[30]; struct student *next; struct student *before; }; int n; struct student *creat(void) { struct student *head,*end; struct student *p1,*p2; char str[5]={"end"}; n=0; p1=p2=( struct student *)malloc(LEN); scanf("%s...
31
15170
struct student { char num[20]; char name[20]; char sex[2]; int age; float score; char add[50]; struct student*next; }; int n; struct student*creat(void) { int juge=1; struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); scanf("%s",p1->num); scanf("%s%s%d%f%s",p1->name,p1-...
31
15171
struct info{ char num[10]; char name[20]; char sex; int age; float grade; char address[10]; struct info *link; }; int main(){ struct info *p1,*p2; p1=p2=NULL; p1=(struct info *)malloc(sizeof(struct info)); scanf("%s",p1->num); if(p1->num[0]=='e') return 0; do{ scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->a...
31
15172
struct info { char id[30]; char name[30]; char gen; int age; float grade; char add[30]; struct info *next; }; int n; struct info *creat(void) { struct info *head; struct info *p1; n=0; head=p1=(struct info*)malloc(LEN); scanf("%s",&p1->id); while(strcmp(p1->id,"end")) { scanf("%s %c %d %f %s",&p1->nam...
31
15173
struct stu* create(); struct stu{ char text[100]; struct stu *prev; }; int main() { struct stu *p; p=create(); while (p){ printf("%s\n", p->text); p = p->prev; } return 0; } struct stu* create(){ struct stu *p1,*p2,*start; p1 = (struct stu *)malloc(sizeof(struct stu)); gets(p1->tex...
31
15174
struct student { char num[16]; char a[64]; struct student *next; }; int n; struct student *creat(void) { struct student *head,*p,*q; n=0; p=q=(struct student *)malloc(len); scanf("%s",p->num); head=null; while(strcmp(p->num,"end")!=0) { gets(p->a); n++; ...
31
15175
struct student {char num[20]; char name[20]; char sex; int age; char score[20]; char add[20]; }; int main() {int i=0,s=0; int t=0; struct student stu[1000]; scanf("%s",stu[0].num); while(stu[i].num[0]!='e'){ scanf("%s %c %d %s %s",stu[i].name,&stu[i].sex,&stu[i].age,stu[i].score,stu[i].add); i++; s++; scanf("%s",stu[i...
31
15176
struct student { char c[100]; struct student*next; }; struct student*creat() { struct student*p1,*p2,*p; int i; p1=p2=(struct student*)malloc(sizeof(struct student)); p=p1; gets(p1->c); while(strcmp(p1->c,"end")!=0) { p1=(struct student*)malloc(sizeof(struct student)); gets(p1->c); if(strcmp(p1->c,"end")...
31
15177
struct stu { char inf[50]; struct stu *next; } a[500]; int main() { // struct stu *head,*point; int sum=0,i=0,j; // point=(struct stu *)malloc(sizeof(struct stu)); while(gets(a[i].inf)!=NULL) { i++; } for(j=i-2;j>=0;j--) { puts(a[j].inf); } return 0; }
31
15178
struct student { char num[20]; char name[20]; char sex; int age; char grade[20]; char address[20]; struct student *next; }; struct student stud[200]; struct student * input() { struct student *head,*p; head=NULL; p=(struct student *)malloc(LEN); scanf("%s",p->num); while(strcmp(p->num,"end")!=0) { scanf(...
31
15179
struct student { char message[300]; 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->message); head=NULL; while(strcmp(p1->message,"end")!=0) { n=n+1; if(n==1)head=p1; else p1->next=p2; p2=p1; p1=(stru...
31
15180
struct student{ char num[100]; char name[100]; char sex; int old; float score; char add[150]; struct student *next; }; void main() { struct student *p1,*p2; int len=sizeof(struct student); p1=(struct student *)malloc(len); p1->next=NULL; scanf("%s",p1->num); while(strcmp(p1->num,"end")!=0){ scanf("%s %...
31
15181
struct student { char inf[1000]; struct student *pNext; }; int main() { int i,j,k,l,m,n; int count=0; struct student a[1000],*pHeader,*p; for(i=0;;i++) { gets(a[i].inf); count=count+1; if(strcmp(a[i].inf,"end")==0) break; } pHeader=&a[count-2]; for(i=count-2;i>=1;i-...
31
15182
struct student { char a[100]; struct student *next; }; int main() { struct student *p1,*p2; p1=(struct student*)malloc(len); p1->next=NULL; gets(p1->a); while((strcmp(p1->a,"end"))!=0) { p2=p1; p1=(struct student*)malloc(len); p1->next=p2; gets(p1->a); } p1=p1->next; while(p1!=NULL) { printf("%s\...
31
15183
struct stu {char num[9]; char nam[50]; char s; int old; double sco; char add[18]; struct stu *next; struct stu *abv; }; void main() {struct stu*head,*p1,*p2; int i=0; head=NULL; do {p1=(struct stu*)malloc(LEN); scanf("%s",&p1->num);if(!strcmp(p1->num,"end"))break; scanf("%s %c %d %lf %s",&p1->nam,&p1->s,...
31
15184
int n; struct student{char stu[50];struct student *next;}; struct student *creat(void) { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); gets(p1->stu); head=NULL; while(strcmp(p1->stu,"end")!=0) { n=n+1; if(n==1)head=p1; else p2-> next=p1; p2=p1; p1=(struct st...
31
15185
struct student { char num[100]; char name[100]; char gender[2]; char age[100]; char score[100]; char add[100]; struct student *next; }; struct student *creat(void) { struct student *head,*p1; head=NULL; while(1) { p1=(struct student*)malloc(LEN); scanf("%s",p1->num); p1->next=head; if(strcmp(p1->num...
31
15186
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() { struct student*head,*end; struct student*p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); head=NULL; scanf("%s",p1->num); wh...
31
15187
struct student { char info[100]; struct student *next; struct student *former;}; int i,j,k,n; void main() { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(len); gets(p1->info); head=0; while(strcmp(p1->info,"end")!=0) { n=n+1; if(n==1) {head=p1; p1->former=0;} else {p2->next=...
31
15188
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(;;) ...
31
15189
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*)mal...
31
15190
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){ st...
31
15191
void myPrint() { char str[100]; gets(str); if(strcmp(str,"end")) myPrint(); else return; puts(str); } int main() { myPrint(); return 0; }
31
15192
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,p...
31
15193
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...
31
15194
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=...
31
15195
// ??????????????? 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("Erro...
31
15196
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;} ...
31
15197
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("...
31
15198
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;}...
31
15199
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...