label
stringlengths
1
2
index
stringlengths
1
5
code
stringlengths
87
8.24k
31
15300
struct student { char xuehao[20]; char name[50]; char sex; int age; float score; char addr[100]; struct student *next; }; void main() { struct student *p1,*p2,*head,*newhead,*p3; int i=1; long n=0; p1=p2=(struct student *)malloc(LEN); head=NULL; scanf("%s %s %c %d%f %s",p1->xuehao,p1->name,&p1->sex,&p1->a...
31
15301
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; 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...
31
15302
struct student { char a[20]; char b[40]; char c; int d; float e; char f[20]; struct student*before; }; int n; struct student* hh() { struct student*p1,*p2,*head;n=0; p1=p2=(struct student*)malloc(LEN); scanf("%s ",&p1->a);head=NULL; while(strcmp(p1->a,"end")) { scanf("%s %c %d %f %s ",&p1->b,&p1->c,&p1->...
31
15303
void main() { struct stu { char num[100]; char nam[100]; char sex; int age; float sco; char add[100]; struct stu *next; }; int len=1,i; struct stu *p1,*p2,*head,*new,*newhead; p1=p2=head=(struct stu *) malloc(sizeof(struct stu)); scanf(...
31
15304
struct Node { char Info[200]; struct Node *Next; }; int Insert(struct Node *Head) { struct Node *Tmp; Tmp=(struct Node *)malloc(sizeof(struct Node)); gets(Tmp->Info); if(strcmp(Tmp->Info,"end")==0) { free(Tmp); return 0; } else { Tmp->Next=Head->...
31
15305
struct student { char num[200],name[80],sex[20],age[30],score[30],add[200]; struct student *next; }; struct student *creat() {struct student *head,*p1,*p2; p1=(struct student*)malloc(LEN); scanf("%s",p1->num); p1->next=0; while(strcmp(p1->num,"end")!=0) { p2=p1; scanf("%s%s%s%s%s\n",p1->name,p1->sex,p...
31
15306
struct sa { char a[500]; struct sa *next; }; int n; struct sa *kao(void) { struct sa *head; struct sa *p1,*p2; n=0; head=NULL; p1=p2=(struct sa *)malloc(len); gets(p1->a); head=p1; for(;;) { n++; if(n==1) p1->next=NULL; else { p2=p1; p1=(struct sa *)malloc(len); ...
31
15307
struct STUDENT { char student[100]; struct STUDENT* former; }; int main() { struct STUDENT* p1 = (struct STUDENT*) malloc(sizeof(struct STUDENT)); struct STUDENT* p2; p1->former = NULL; for (gets(p1->student);p1->student[0]!='e'; gets(p1->student)) { p2 = p1; p1 = (struct STUDENT*) malloc(sizeof(struct STUDE...
31
15308
struct student { char num[100]; struct student *next; }; main() { int n; struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); gets(p1->num); while(p1->num[0]!='e') { n=n+1; if(n==1) p1->next=NULL; e...
31
15309
struct student { char num[10]; char name[30]; char gender; int age; char score[10]; char address[30]; struct student *before; }; void main () { struct student stu[1000], *tail, *p; int i=0,j; while (scanf ("%s %s %c %d %s %s",&stu[i].num, &stu[i].name, &stu[i].gender, &stu[i].age, &stu[i].score, &st...
31
15310
struct student {char c[300]; struct student *next; }; int n; struct student * create() {struct student *head,*p1,*p2; n=0; p1=p2=head=(struct student*)malloc(Len); gets(head->c); head->next=0; while (strcmp("end",p1->c)!=0) {head=p1; p1=(struct student*)malloc(Len); p1->next=head; gets(p1->c); } return h...
31
15311
struct stu { char num[20],name[20],add[30],sex; int age; float score; struct stu *next; } main() { struct stu *p1,*p2; p1=(struct stu*)malloc(len); p1->next=NULL; while(1) { scanf("%s",p1->num); if(!strcmp(p1->num,"end")) break; scanf("%s %c %d %f %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->add); p2=...
31
15312
struct student { char num[1000]; struct student *next; }; int n; struct student * creat (void ) { struct student * head; struct student *p1,*p2; char a[4]={"end"}; n=0; p1=p2= (struct student *)malloc(LEN); gets( p1->num ); head = NULL; while (strcmp(p1->num,a)!=0) { n=n+1; if (n==1) head =p1; else p...
31
15313
struct student { char what[100]; struct student *last; }; void print(struct student *p) { printf("%s\n",p->what); if(p->last!=NULL)print(p->last); } main() { struct student stu,*head,*tail,*p1,*p2; tail=(struct student*)malloc(LEN); tail->last=NULL; gets(tail->what); ...
31
15314
struct student { char ID[20]; char name[20]; char sex; int age; char score[20]; char address[20]; struct student*next; }; struct student*creat() { struct student*head,*p1,*p2; 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=NUL...
31
15315
struct student {char num[20]; char name[20]; char sex; int age; float score; char address[20]; struct student *next; }; void main() { struct student *p1,*p2,*head,*p; p1=p2=(struct student *) malloc(LEN); scanf("%s",p1->num); p1->next=NULL; while(p1->num[0]!='e') { scanf("%s %c%d%f%s",p1->name,&p1->sex,&p1->a...
31
15316
struct stu{ char info[50]; struct stu *next; }; int main(int argc, char* argv[]) { struct stu *head,*p1,*p2; p2=NULL; while(1){ p1=(struct stu*)malloc(LEN); gets(p1->info); if(strcmp(p1->info,"end")==0){ break; } p1->next=p2; p2=p1; } head=p2; p1=head; while(1){ printf("%s\n",p1->info); if...
31
15317
struct student { char id[1000]; struct student *pre,*next; }; void main() { struct student *p1,*p2,*head1,*head2; int n=0; char temp[1000]; p1=p2=NULL; while(gets(temp),strcmp(temp,"end")!=0) { n=n+1; p1=(struct student *)malloc(sizeof(struct student)); p1->pre=NULL; p1->next=NULL; head1=NULL; ...
31
15318
struct student { char num[50]; /*??*/ char name[50];/*??*/ char sex;/*??*/ int year;/*??*/ char score[50]; /*??*/ char add[50];/*??*/ struct student *next; /*?????????*/ }; int n; /*????*/ struct student *Create() { struct student *head; /*???*/ struct student *p1=NULL; /*p1???????????*/ struct student *p2=...
31
15319
struct student { char num[20]; char name[20]; char sex; int age; char score[10]; char add[20]; struct student *next; }; int n=0; struct student *creat(void) { struct student *head,*p1,*p2; p1=p2=(struct student *)malloc(LEN); head=NULL; scanf("%s",p1->num); if(p1->num[0]=='e') return(head); scanf(...
31
15320
struct student { char num[10]; char name[30]; char sex; int age; char score[10]; char address[20]; struct student *next; }; struct student *creat() { struct student *head,*p; head=(struct student*)malloc(Len); scanf("%s",head->num); if(strcmp(head->num,"end")==0) head=NULL; else scanf("%s %c %d ...
31
15321
struct student { char num[100]; struct student *next; }; main() { int n,i; struct student *head,*p1,*p2,*p; n=0;p1=p2=(struct student*) malloc(LEN); gets(p1->num); 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); gets(...
31
15322
struct student { char ID[20]; char name[20]; char sex; int age; char score[20]; char address[20]; struct student *next; }; struct student *create() { struct student *head,*p1,*p2; p1=(struct student*)malloc(LEN); scanf("%s",p1->ID); if(strcmp(p1->ID,"end")==0){free(p1);head=NULL;} else { head=p1; scan...
31
15323
void main() { char s[1000][100]; int i=0,k; gets(s[0]); while(s[i][0]!='e') { i=i+1; gets(s[i]); } for(k=i-1;k>=0;k--) { puts(s[k]); } }
31
15324
struct student { char num[20],name[20],dizhi[20],xb; int year; float score; struct student *next,*pre; }; struct student *create() { struct student *head,*p1,*p2; p1=(struct student*)malloc(LEN); scanf(TYPE,p1->num,p1->name,&p1->xb,&p1->year,&p1->score,p1->dizhi); head=p1; p1->pre=NULL; p2=p1; while(1) ...
31
15325
struct stu { char id[500]; struct stu *next; struct stu *pre; }; void main() { int n; struct stu *p1,*p2,*head,*tail,*p; n=0; p1=p2=(struct stu*)malloc(sizeof(struct stu)); gets(p1->id); while(strcmp(p1->id,"end")!=0) { n=n+1; if(n==1) { head=p1; p1->pre=NULL; } else { p2->next=p1; ...
31
15326
/* * 78.cpp * ?????? * Created on: 2011-12-11 * ?????????????????????????????????????????? */ int main() { int i,j; struct { char number[40]; char name[40]; char sex; int old; double point; char address[40]; }student[1000]; for(i=0;i<1000;i++) { cin>>student[i].number; if((student[i].number...
31
15327
struct student { char a[80]; struct student *pro; }; struct student *creat() { struct student *end,*p1,*p2; p2=(struct student *)malloc(sizeof(struct student)); gets(p2->a); p2->pro=NULL; p1=p2; do { p2=(struct student *)malloc(sizeof(struct student)); gets(p2->a); if (strcmp(p2->a,"end")==0) { f...
31
15328
struct student { char num[20]; char name[20]; char gender; int age; char score[20]; char add[200]; struct student *prev; struct student *next;//???????????? }*head=0,*tail=0; void add_node(char*a,char*b,char c,int d,char* e,char* f) { if(head==0) { head=tail=(struct student*...
31
15329
struct student { char num[10],name[50],addr[50],score[10],sex; int age; struct student *before; }; void main() { struct student *p1=0,*p2; p2=(struct student *)malloc(len); while(scanf("%s %s %c %d %s %s",p2->num,p2->name,&(p2->sex),&(p2->age),p2->score,p2->addr)!=EOF) { if(p2->num[0]=='e') break; p2...
31
15330
int main() { struct student { char a[100]; struct student *back; }; int n; struct student *p1,*p2,*end; p1=p2=(struct student *)malloc(sizeof(struct student)); gets(p1->a); p1->back=0; for (n=1;;n++) { p1=(struct student * )malloc(sizeof(struct student)); p1->back=p2; p2=p1; gets(p1->a); if (p1...
31
15331
struct student { char a[60]; struct student*next; }; void main() { struct student *creat(void); struct student *p; p=creat(); for(;p!=NULL;) { puts(p->a); p=p->next; } } struct student *creat(void) { struct student *head; struct student *p1,*p2; int n=0; p1=p2=(struct student *)malloc(LEN); gets(p1->a...
31
15332
struct stu { char infor[50]; struct stu*previous; }; void main() { struct stu*p,*q,*head; p=(struct stu*)malloc(sizeof(struct stu)); p->previous=NULL; gets(p->infor); while(strcmp(p->infor,"end")!=0) { q=(struct stu*)malloc(sizeof(struct stu)); q->previous=p; p=q; gets(p->infor); } head=p->prev...
31
15333
struct stu { char num[40]; char name[40]; char sex[10]; char year[10]; char score[40]; char add[40]; struct stu *fw; struct stu *bw; }; int n; struct stu *tail; struct stu *create(void) { int i; struct stu *head,*p1,*p2; head=(struct stu *)malloc...
31
15334
struct student { char num[20]; char name[20]; char sex[5]; int age; char score[10]; char address[30]; struct student *next; }; int n; int main() { struct student *p1,*p2,*p; n=0; p1=p2=(struct student *)malloc(LEN); scanf("%s",p1->num); while(p1->num[0]!='e') { n++; if(n==1)p1->next=NULL; scanf("%s%s...
31
15335
struct student { char inf[100]; struct student*next; }; int n; struct student*creat(void) { struct student*head; struct student*p1,*end; n=0; p1=(struct student*) malloc(LEN); gets(p1->inf); head=end=NULL; while(strcmp(p1->inf,"end")!=0) { n=n+1; if(n==1) { p1->next=head; end=p1; } else ...
31
15336
int main() { struct joyan { char num[10]; char name[20]; char sex[1]; int age; float score; char add[20]; struct joyan * next; }; struct joyan *head,*p1,*p2; p1=p2=head=(struct joyan *)malloc(LEN); scanf("%s%s%s%d%f%s",p1->num,p1->name,p1->sex,&p1->age,&p1->score,p1->add); p1->next = NULL; int ...
31
15337
// // main.c // Track 82,???????????? // // Created by Charles.thRay.Lee on 2/1/13. // Copyright (c) 2013 Peking University. All rights reserved. /* ?? ??????????????????????????????????????? ???? ????????????????????? 00630018 zhouyan m 20 10.0 28#460 ??????"end"?? ???? ?????????? ????????? ?? ?? ?? ...
31
15338
struct student { char id[20]; char name[20]; char sex; int age; char score[20]; char addr[20]; struct student *next; struct student *before; }; int n; struct student *creat(void) { struct student *head,*p1,*p2; n=0; p1=p2=(struct student *)malloc(LEN); scanf("%s",p1->id); head=NULL; while(strcmp(p1->id,"e...
31
15339
/*?? ?? ?? ?? ?? ??*/ struct student { struct student *pre; char num[100]; char name[20]; char sex[2]; char age[10]; char score[10]; char ad[100]; struct student *next; }; 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...
31
15340
struct student { char num[1000]; struct student *next; }; int main() { struct student s[1000],*p,*pheader; int i=0; int n; char ch; for (i=0;;i++) { gets(s[i].num); if (strcmp(s[i].num,"end")==0) break; } n=i; pheader=&s[n-1]; for (i=n-1;i>=1;i--) { s[i].next=&s[i-1]; } s[0].next=NULL; p=ph...
31
15341
struct Student { char id[200]; char name[200]; char sex[1]; int age; float mark; char address[200]; struct Student *next; }; int main() { struct Student *p, *head, *tail; head = tail = NULL; while(1) { p = (struct Student *) malloc(LEN); scanf("%s", p->id); if(p->id[0] == 'e') break; scanf("%s", p...
31
15342
int main() { int i; struct student { char num[100]; char name[100]; char sex; int age; char score[100]; char address[100]; struct student *next; }a[10000],*head,*p; int n; for(i=0;i<10000;i++) { scanf("%s",a[i].num); if(a[i].num[0]=='e') {break;} scanf("%s %c %d %s %s",a[i].name,&a[i].sex,&...
31
15343
struct student { char s[100]; struct student *next; }; struct student *creat() { struct student *head,*p1,*p2; p1=(struct student *)malloc(len); gets(p1->s); p1->next=null; do { p2=(struct student *)malloc(len); gets(p2->s); p2->next=p1; p1=p2; } while(strcmp(p2->s,"end")); head=p2; re...
31
15344
struct stu{ char num[20]; char name[20]; char gen; int age; float mark; char add[20]; struct stu *next; }; char end[4]="end"; int main() { struct stu *p1,*p2,t; p1=p2=NULL; while(scanf("%s",t.num),strcmp(t.num,end)!=0) { scanf("%s %c %d %g %s\n",t.name,&t.gen,&t.age,&t.mark,t.add); p1=(struct stu *)mallo...
31
15345
struct student { char input[500]; struct student *next; }; void main() { char c[500]; struct student *head; struct student *p1,*p; head=NULL; while(strcmp(gets(c),"end")!=0) { p1=(struct student *)malloc(LEN); strcpy(p1->input,c); p1->next=head; head=p1; } p=head; do { puts(p->input); p...
31
15346
struct stu { char id[10]; char name[20]; char sex; int age; char score[10]; char addr[20]; struct stu *next; }; int main() { struct stu *creat(void); void output(struct stu*head); struct stu *head,*p; head=NULL; head=creat(); p=head; o...
31
15347
struct stud { char no[50]; char name[50]; char sex; int y; char sc[30]; char addr[50]; struct stud *pre; }; struct stud *creat() { struct stud *p1,*p2; char *g="end"; p1=p2=(struct stud *) malloc(LEN); p1->pre=NULL; scanf("%s",p1->no); while(strcmp(p1->no,g)) { scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1-...
31
15348
struct student /*??student?????????????????????????*/ { char num[40]; int age; char score[20]; char name[40]; char gender; char addr[40]; struct student *next; }*p1,*p2; /*???p1,p2?????????????*/ int n; struct student *creat(void); /*????...
31
15349
struct student {char a[50]; struct student *prev; }; void main() { void print(struct student *head); int n=0; struct student *head; struct student *p1,*p2; p1=head=(struct student *)malloc(len);/*???????*/ gets(p1->a); p2=NULL; while(strcmp(p1->a,"end")!=0) { n++; if(n==1) p2=p1; else p1->prev=head...
31
15350
struct a { char s[6][100]; struct a *next; }head; int tot=0; void init() { int i; struct a *p; head.next=NULL; while(1) { p=(struct a *)malloc(sizeof(struct a)); scanf("%s",p->s[0]); if(!strcmp(p->s[0],"end")) break; for(i=1;i<6;i++) { sc...
31
15351
struct xs { char num[10]; char name[30],sex[2],adr[100],grade[20]; int year; struct xs *next; }; struct xs *creat()// ?0?7?0?9×?0?0·?0?4 ?0?3?0?1 NULL ?0?4?0?1?0?7à?0?6?0?0?0?8?0?5?0?8×?0?8?0?1?0?0· { struct xs *head,*p1,*p2; p1=p2=(struct xs *)malloc(LEN); head=NULL; p1->next=NULL; ...
31
15352
struct s { char xh[50]; char xm[55]; char xb; int nl; char df[50]; char dz[50]; struct s *next; }; void main() { struct s *head,*p1,*p2,*p; p2=(struct s *)malloc(len); scanf("%s",p2->xh); p2->next=NULL; while(strcmp(p2->xh,"end")!=0) { scanf("%s",p2->xm); scanf(" %c",&p2->xb); scanf(" %d",&p2->nl); scanf(" %s",p2->df);...
31
15353
struct student { char num[20]; char name[30]; char sex; int age; char score[20]; char add[40]; struct student *next; }; void main() { struct student *p1,*head; head=(struct student *)malloc(L); p1=head->next=NULL; scanf("%s",head->num); while(strcmp(head->num,"end")!=0) { p1=head; scanf(" %s %c %d %s %...
31
15354
struct student { char id[50]; char *name; char sex; short int age; float score; char *add; struct student *next; }; int n; struct student *creat(void) { struct student *p1,*head,*p2; n=0; head=NULL; p2=p1=(struct student*)malloc(sizeof(struct student)); gets(p1->id); while(strcmp(p1->id,"end")!=0) { ...
31
15355
struct Student { char imf[100]; struct Student *next,*pre; }; int main() { struct Student *p,*q,*h; h=p=q=malloc(LEN); gets(q->imf); q->pre=q->next=NULL; while(strcmp(q->imf,"end")!=0) { p=q; q=malloc(LEN); q->next=NULL; q->pre=p; p-...
31
15356
struct student { char s[10]; char name[30]; char sex; char age[3]; char score[6]; char place[15]; struct student *next; struct student *last; }; int n; struct student *creat() { struct student *head1,*head2; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(100); head1=NULL;scanf("%s ",&p1->s);...
31
15357
struct stu { char a[100]; struct stu *prev; struct stu *next; }; void main() { struct stu *end,*p1,*p2,*head; int m,n,j; p1=(struct stu*)malloc(sizeof(struct stu)); end=p1; p2=p1; gets(p1->a); p1->next=0; scanf("\n"); for(;;) { p1=(struct stu*)malloc(sizeof(struct stu)); gets(p1->a); scanf("\n"); i...
31
15358
struct student { char num[30]; char name[40]; char sex[2]; int age; float score; char add[50]; struct student *next; }; int n; struct student *creat() { struct student *head; struct student *p1,*p2; n=0; p1=p2=( struct student * ) malloc(LEN); scanf("%s",p1->num); head=0; while(strc...
31
15359
struct Student { char id[100]; char name[300]; int age; char sex; char score[100]; char address[300]; struct Student *before; }s[2500]; main() { struct Student *p,*q,*head; int i=0,j,k,n,m; scanf("%s",&s[0].id); p=&s[0]; q=NULL; while (p!=NULL) { scanf("...
31
15360
struct stu { //???????? char stunum[10]; char name[20]; char sex[3]; char age[10]; char mark[10]; char add[20]; struct stu *next,*before;//?? }; void main() { struct stu *p,*pt,*head; int i=0,n=0; char a[4]; strcpy(a, "end"); pt=p=head=(struct stu *)malloc(Len); for(i=0;;i++) { scanf("%s",&p->stunum);...
31
15361
struct stu{ char name[20]; char num[10]; char x[5]; int y; float f; char add[100]; struct stu *next; }; int main() { struct stu *p1,*p2; p1=(struct stu *)malloc(sizeof(struct stu)); p1->next=0; scanf("%s",p1->num); while(p1->num[0]!='e') { scanf("%s%s%d%f%s",p1->name,p1->x,&p1->y,&p1->f,p1->add...
31
15362
struct Student { char stu[500]; struct Student * next; }; int n=0; void main() { struct Student * creat(); void print(struct Student *head,int num); struct Student *head; head=creat(); int i=0; for(i=n;i>0;i--) print(head,i); } struct Student * creat() { struct Student *p1,...
31
15363
main() { struct h {char mun[10]; char name[20]; char sex; int age; float score; char add[20]; struct h *p; } ; struct h *a,*b; a=len; a->p=NULL; int i; for(i=0;i<1000;i++) {scanf("%s",a->mun); if(!strcmp(a->mun,"end")) break; scanf("%s %c %d %f %s",a->name,&a->...
31
15364
struct student { char inf[200]; struct student *next; }; int n; struct student *creat(void) { struct student *head; struct student *p1,*p2; n=0; p1=(struct student *)malloc(LEN); p2=p1; gets(p1->inf); head=NULL; do { n=n+1; if(n==1)head=p1; else p2->next=p1; p2=p1; p1=(struct student *)malloc(LEN);...
31
15365
struct student { char infor[100]; struct student *next; }; struct student *creat(void) { struct student *head; struct student *p1,*p2; int n; char l[4]={"end"}; n=0; p1=p2=(struct student *)malloc(LEN); gets(p1->infor); head=NULL; while(strcmp(p1->infor,l)!=0) {...
31
15366
int n=1; struct student {char num[20]; char name[20]; char sex; int age; char score[10]; char ad[20]; struct student *next; }; struct student* appendnewnode(void) { struct student *newnode,*thisnode; int x; do{ newnode=(struct student*)malloc(sizeof(struct student)); scanf("%s",newnode->num); getchar(); x...
31
15367
struct Student{ char stu[100]; struct Student *next; }; int main() { struct Student *p,*head,*p1,*p2; int n = 0; p2 = p1 = (struct Student *)malloc(Len); head = NULL; gets(p1->stu); while(strcmp(p1->stu,"end")!=0){ n++; head = p1; if (n==1) p1->next = NULL; else{ p1->next = p2; p2 = p1; } ...
31
15368
struct xinxi { char stu[1000]; struct xinxi *next; }; void main() { struct xinxi *head,*p,*pt; int i,n; p=(struct xinxi *)malloc(sizeof(struct xinxi)); gets(p->stu); pt=p; head=(struct xinxi *)malloc(sizeof(struct xinxi)); n=0; while(strcmp(p->stu,"end")!=0) { n=n+1; if(n==1)head->next=p; if(n>1)pt->...
31
15369
struct stu { char inf[100]; struct stu *next; }; void down(struct stu *now) { if (now->next!=0) down(now->next); if (now->next!=0) printf("%s\n",now->inf); } int main() { void down(struct stu *now); struct stu *head,*now,*neww; head=(struct stu*) malloc(sizeof(struct stu)); ...
31
15370
struct student { char id[10]; char name[20]; char sex[2]; int age; char s[10]; char add[20]; struct student *next; }; struct student *creat(void) { struct student *head,*p1,*p2; int i=0; p1=p2=(struct student*)malloc(LEN); head=NULL; while(scanf("%s",p1->id)&&*p1->id>=48&&*p1->id<=57) ...
31
15371
struct stu { char x[300]; struct stu *next; }; void creat1(struct stu *head,char *p) //????? { struct stu *pre,*p1,*s; s=(struct stu *)malloc(sizeof(struct stu)); strcpy(s->x,p); pre=head; p1=pre->next; pre->next=s; s->next=p1; } void creat2(struct stu *head,...
31
15372
main() { char s[1000][1000]; int i=0,n=0; while(1) { gets(s[n]); if(s[n][0]=='e') break; else n++; } for(i=n-1;i>=0;i--) {puts(s[i]);printf("\n");} }
31
15373
// ??????????.cpp : ?????????????? // struct student { char info[100]; struct student *pre; }; struct student *creat() { struct student *p1,*p2,*head; p1=(struct student*)malloc(L); gets(p1->info); if(strcmp(p1->info,"end")==0) { return(NULL); exit; } else { p2=NULL; for(int i=1;;i++) ...
31
15374
struct student { char num[10]; char name[30]; char sex[2]; char age[5]; char score[10]; char add[20]; struct student *prev; }; struct student *create(void) { struct student *p1,*p2; p1=(struct student *)malloc(sizeof(struct student)); scanf("%s",p1->num); if(strcmp(p1->num,"end")) { scanf("%s%s%s%s%s",p1...
31
15375
struct student { char num[200]; struct student *next; }; void main() { int n,i,k,j; struct student *head; struct student *p1,*p2; struct student *newhead,*nnew; n=0; p1=p2=(struct student *)malloc(sizeof(struct student)); gets(p1->num); head=NULL; while(strcmp(p1->num,"end")!=0) { n=n+1; i...
31
15376
struct stu { char information[100];//???????????????????????????? struct stu*next;//?????? struct stu*last;//?????????????????????????? }; struct stu*creat(void) { struct stu *end,*p1,*p2; int flag=1; p1=(struct stu*)malloc(Len); gets(p1->information); if(strcmp(p1->information,"end")==0) //?????????????? ...
31
15377
struct student{ char info[100]; struct student *before; }student[10000]; int main() { void print(struct student *p); int i=0,j; char a[10000][100]; gets(a[0]); while(a[i][0]!='e'){ strcpy(student[i].info,a[i]); ...
31
15378
//??? int main() { struct student { char id[200]; char name[200]; char sex; int age; double score; char add[200]; }stu[1000]; int i=0; while(cin>>stu[i].id) { if(strcmp(stu[i].id,"end")==0) break; else cin>>stu[i].name>>stu[i].sex>>stu[i].age>>stu[i].score>>stu[...
31
15379
struct student { char inf[100]; struct student *next; struct student *last; }; int n; struct student *end; struct student *creat(void) { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); gets(p1->inf); head=NULL; while(1) { n=n+1; if(n==1)head=p1; else {p2->next=p1;...
31
15380
struct student { char num[100]; char name[100]; char sex; int age; char score[20]; char address[100]; struct student *next; }; struct student *creat() { struct student *head,*p1,*p2; p1 = (struct student*)malloc(len); p2 = p1; scanf("%s",p1->num); if(strcmp(p1->num,"end") == 0) {head = p1;p1->next = ...
31
15381
int main(){ int i,n; struct information{ char num[20]; char name[20]; char sex; int age; char score[100]; char address[20]; }stu[1000]; //???? for(i=0;i<1000;i++){ cin>>stu[i].num; if((stu[i].num[0]=='e')&&(stu[i].num[1]=='n')&&(stu[i].num[2]=='d')){ n=i-1; break;} //???end????? else{ cin>>stu[i].nam...
31
15382
char ss[]={'e','n','d'}; int n=0; struct st { char s[200]; struct st *next1; }; void main() { struct st *p; struct st *creat(void); int i=0; struct st *head; struct st *p1,*p2; p1=p2=(struct st *)malloc(len); p1->next1=NULL; gets(p1->s); head=p1; while(1) { n++; if(n==1)head=p1; p2=p1; p1=(struct s...
31
15383
struct stu{ char num[20]; char name[20]; char gender; int age; float score; char address[20]; struct stu *next; }; struct stu *creat() { struct stu *head,*p1,*p2; head=p1=p2=(struct stu *)malloc(LEN); head->next=NULL; scanf("%s",p1->num); SCAN; for(;;) { p1=(struct stu *)malloc(LEN); scanf("%s...
31
15384
struct student { char num[20]; char name[20]; char sex; int age; float grade; char addr[100]; struct student *next; }; struct student *creat() { struct student *pt,*pn; pn=(struct student *)malloc(sizeof(struct student)); pt=0; scanf("%s",pn->num); pn->next=0; while(pn->num[0]!='e') { scanf("%s %c %d %f...
31
15385
struct stu { char num[15]; char name[20]; char sex; int age; char score[10]; char addr[15]; struct stu* next; }; int main() { struct stu* p1,*p2; p1=(struct stu*)malloc(len); scanf("%s%s %c%d%s%s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->addr); p1->next=NULL; while(1) { p2=(struct stu*)malloc(len...
31
15386
struct stu { char a[1000]; struct stu *next; }; void main() { struct stu *head,*p1,*p2; p1=p2=(struct stu*)malloc(LEN); head=p1; p1->next=NULL; gets(p1->a); while (strcmp(p1->a,"end")!=0) { p1=(struct stu*)malloc(LEN); gets(p1->a); head=p1; p1->next=p2; p2=p1; } p1=head->next; while (p1!=NULL...
31
15387
typedef struct student { char num[20]; char name[20]; char sex[2]; char age[3]; char mark[10]; char add[30]; struct student *next; } stu; int n; stu* rcreate() { stu *head,*p; head=p=(stu*)malloc(LEN); scanf("%s",p->num); p->next=NULL; if(strcmp(p->num,"end")==0) { head=NULL; return(NULL); } while(st...
31
15388
struct student { char num[100]; char name[100]; char gender; int age; float score; char add[100]; struct student *next; }; int n; struct student *head=0; struct student * creat(void) { struct student *p1,*p2; n=0; p1=p2=(struct student *) malloc(LEN); while(strcmp(p1->num,"end")!=0) { n++; if(n==...
31
15389
struct S { char xuehao[200]; char xingming[200]; char xingbie; int nianling; float defen; char dizhi[200]; struct S *next; }; int main() { struct S *p1,*p2,*head; head=(struct S *)malloc(sizeof(struct S)); p1=head; scanf("%s",p1->xuehao); head->next=NULL; while(p1->xuehao[0]!='e') { scanf("%s %c%d%f %s"...
31
15390
/* * tongjixueshengxinxi.cpp * * Created on: 2011-12-18 * Author: 1100012857 */ int main(void) { struct student { char stunum[100]; char stuname[20]; char sex; int age; char score[20]; char location[20]; //struct student *next; }stu[990]; int i; for(i=0;;i++) { cin>>stu[i].stunum; if(...
31
15391
struct student { char num[10]; char name[20]; char sex; int age; char score[10]; char add[15]; struct student *next; }; void main() { struct student *p1,*p2,*head; int n=0; p1=p2=(struct student*)malloc(LEN); p1->next=NULL; scanf("%s",p1->num); while(strcmp(p1->num,"end")!=0) { scanf("%s %c %d %s %s\n",...
31
15392
struct student { char con[50]; struct student *next; }; int n; struct student *creat(void) { struct student *head,*p,*q; n=0; p=q=(struct student *)malloc(len); gets(p->con); head=null; while(strcmp(p->con,"end")!=0) { //scanf("%s %c %d %d %s",p->name,&p->gender,&p->age,&p->...
31
15393
struct student { char number[30]; char name[30]; char gender; int age; char score[30]; char add[30]; }; int main() { int lengthofnumber[505]={0},lengthofname[505]={0},lengthofadd[505]={0},lengthofscore[505]={0}; int i,j,numberofstudent=0; struct student stu[505]; for(i=0;i<505;i++) {//read for(j...
31
15394
struct stu { char num[20]; char name[20]; char s; int age; char point[10]; char adr[50]; struct stu *p; }; void main() { struct stu *stu1=NULL; int n=sizeof(struct stu); stu1=(struct stu *) malloc(n); struct stu *head=NULL,*curent=NULL; stu1->p=NULL; while(scanf("%s",stu1->num)) { if((strcmp(stu1->num,"...
31
15395
struct student { char num[20]; char name[20]; char ch[1]; int ye;char gra[10];char add[20]; struct student *next; }; int main() { struct student *p,*p1,*p2; int n; p1=p2=(struct student*) malloc(LEN); scanf("%s",&p1->num); p=NULL;n=0; while (p1->num[0]!='e') ...
31
15396
struct student { char num[9]; char name[20]; char sex; int age; float grade; char address[20]; struct student *next; }; void main() { int n=1,i; struct student *thisnode,*newnode,*p; for(i=1;;i++) { newnode=(struct student *)malloc(LEN); scanf("%s",newnode->num); if(newnode->num[0]=='e') break; ...
31
15397
struct st { char id[200]; struct st *pre; struct st *next; } *p1, *p2; int main(void) { p1 = p2 = (struct st*)malloc(LEN); p1->pre = NULL; gets(p1->id); while(strcmp(p1->id,"end")) { p2->next=p1; p2=p1; p1=(struct st*)malloc(LEN); gets(p1->id); p1...
31
15398
struct student { char num[10]; char qita[50]; struct student *last; }; void main() { int l; struct student *end,*head,*p1,*p2; l=sizeof(struct student); end=(struct student*)malloc(l); head=(struct student*)malloc(l); scanf("%s",head->num); gets(head->qita); head->last=end; end->last=NULL; p1=head; p2=h...
31
15399
struct student { char num[30]; char name[50]; char sex; int age; float score; char addr[100]; struct student *next; struct student *pre; }; int n; struct student *end; struct student *creat() { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(sizeof(struct student)); scanf(...