label
stringlengths
1
2
index
stringlengths
1
5
code
stringlengths
87
8.24k
31
15000
struct Stu { char stu[100]; struct Stu *link; }; int main() { struct Stu *p1,*p2; p2=p1=(struct Stu *)malloc(LEN); gets(p1->stu); p1->link=NULL; for(;;) { p2=p1; p1=(struct Stu *)malloc(LEN); gets(p1->stu); p1->link=p2; if(strcmp(p1->stu,"end")==0)...
31
15001
int n; struct student { char num[10]; char name[20]; char sex[2]; int year; int score[10]; char add[10]; struct student *next; }; struct student *creat() { struct student *head,*p1,*p2; p1=(struct student*)malloc(LEN); scanf("%s %s %s %d %s %s",p1->num,p1->name,p1->sex,&p1->year,p1->score,p1->add); p1->...
31
15002
typedef struct node{ char id[100],name[100],sex[2],address[100],age[10],grade[10]; struct node *next; }node; node *head=NULL; int create(){ node *p = (node*)malloc(sizeof(node)); scanf("%s",p->id); if(p->id[0]=='e'){free(p);return 1;} scanf("%s%s%s%s%s",p->name,p->sex,p->age,p->grade,p->address); p->next = h...
31
15003
struct student {char num[20]; char name[20]; char sex; int age; char score[20]; char add[20]; struct student *next; }; int main() { struct student *p; struct student *p1,*p2; p1=(struct student*)malloc(len); (*p1).next=0; scanf("%s",(*p1).num); while((*p1).num[0]!='e'){ scanf("%s %c %d %s %s",(*p1).name,&(*p1).sex,&(*...
31
15004
int main() { int n=0; struct student { char num[20]; char name[20]; char sex[5]; int age; char score[10]; char add[100]; struct student *next; }*p1,*head,*p2,*end,*p3,*heade; head=NULL; p2=p1=(struct student *)malloc(LEN); scanf("%s",p1->num); if(p1->num[0]!='e') { head=p1; scanf("%s %s %d %s...
31
15005
struct stu {char num[50]; struct stu * next; }; void main() { struct stu * head,*p1,*p2; int i=1; p1=p2=(struct stu *)malloc(L); gets(p1->num); head=p1; while((strcmp(p1->num,"end")!=0)) { p1=(struct stu*) malloc(L); gets(p1->num); p2->next=p1; p2=p1;i++; } p2->next=0; int k; for(;i>1;i--) { k=...
31
15006
struct stud { char num[30]; char name[20]; char sex; int age; char score[10]; char address[30]; struct stud *next; }; int main() { struct stud *head,*p1,*p2,*p; int n=0; p1=p2=(struct stud *)malloc(sizeof(struct stud)); scanf("%s",&p1->num); if (strcmp(p1->num,"end")==0) return 0; scanf("%s %c %d %s %s",&p...
31
15007
struct student { char num[10]; char name[20]; char sex[2]; int age; float score; char address[40]; struct student *next; }; void main() { struct student *p,*p1,*p2; p1=(struct student *)malloc(len); p1->next=NULL; scanf("%s",p1->num); while(p1->num[0]!='e') { scanf("%s%s%d%f%s",p1->na...
31
15008
struct student { char num[20]; char name[20]; char sex[2]; int age; float score; char add[100]; struct student *next; }; int main() { struct student *p1,*p2,*head; p1=(struct student*)malloc(sizeof(struct student)); p1->next=NULL; scanf("%s",p1->num); if (p1->num[0]!='e') { while (p1->num[0]!='e') { ...
31
15009
struct student { char num[20]; char name[20]; char sex; int age; float score; char address[1000]; struct student *next; }stu[10000]; int main() { struct student *head,*p; int i,j; char str[4]="end"; for(i=0;;i++) { scanf("%s",stu[i].num); if(strcmp(stu[i].num,str)==0) break; scanf("%s",&s...
31
15010
struct student { char num[100]; struct student *prev; }; main() { struct student *p1,*p2; int flag=0; while (1) { p1=(struct student *)malloc(sizeof(struct student)); gets(p1->num); if (*(p1->num)=='e') break; else { if (flag==0) { p2=p1; p1->prev=NULL; flag=1; } else { ...
31
15011
struct student { char id[50]; char s[50]; char sex; int age; char score[10]; char add[20]; struct student *po; }; int main() { struct student *p,*q; q=(struct student*)malloc(LEN); scanf("%s %s %c %d %s %s",q->id,q->s,&q->sex,&q->age,q->score,q->add); q->po=NULL; p=q; ...
31
15012
int n; struct student { char s[100]; struct student *next; }; void main() { struct student *head, *p1, *p2; n=0; p1=p2=( struct student*) malloc(LEN); gets(p1->s); head=NULL; while(p1->s[0]!='e') { n=n+1; if(n==1) p1->next=NULL; else p1->next=p2; p2=p1; p1=(struct student*)malloc(LEN); gets(p1->s); } head=p2; p1...
31
15013
struct Student { char r[200]; struct Student *next,*up; }; int main() { struct Student *p,*h,*pre; h=NULL; while (1) { p=malloc(L); if (h==NULL) { h=p; p->up=h; } else { pre->next=p; p->up=pre; } gets(p->r); if (strcmp(p->r,"end")==0) break; //scanf("\n"); pre=p; } p=pre; wh...
31
15014
struct student{ char num[50]; char name[50]; char sex[50]; char age[50]; char score[50]; char adr[50]; struct student *next; };//????????????? int main(){ struct student *p1,*p2,*head; p1=(struct student *)malloc(LEN); int i=0; p2=NULL; for(;;i++) { p1=(struct student *)malloc(LEN); scanf("%s",p1->num)...
31
15015
struct stu { char xinxi[100]; struct stu *next; }; void main() { int len=1,i; struct stu *p1,*p2,*head,*new1,*newhead; p1=p2=head=(struct stu *)malloc(sizeof(struct stu)); gets(p1->xinxi); while(strcmp(p1->xinxi,"end")!=0) { p1=(struct stu *)malloc(sizeof(struct stu)); gets(p1->xinxi); if(strcmp(p1->xinxi...
31
15016
int main() { struct student { char a[20]; char b[20]; char c[20]; char d[20]; char e[20]; char f[20]; struct student *pNext; }; struct student *pHeader = (struct student *)malloc(sizeof(struct student)); pHeader->pNext=NULL; struct student *p; while(1) { p...
31
15017
struct stu { char num[20]; char name[20]; char sex; int age; char score[20]; char add[20]; struct stu *next; }; int main() { struct stu *p1,*p2,*head; p1=(struct stu*)malloc(sizeof(struct stu)); p1->next=NULL; p2=p1; p1=(struct stu*)malloc(sizeof(struct stu)); while(1) { scanf("%s",p1->num); if(p1->nu...
31
15018
main() { int i,j,k,n,m; struct student { char num[200]; char name[200]; char sex; int age; char score[20]; char add[500]; }stu[1000]; i=0; while(1) { scanf("%s...
31
15019
struct L { char a[6][20]; struct L *pq; struct L *ph; }; struct L *creat(void) { struct L *p1,*p2,*p3,*head,*end; int i,j,k,l; l=sizeof(struct L); p1=head=(struct L *)malloc(l); p1->pq=NULL; do { for(i=0;i<6;i++) scanf("%s",p1->a[i]); p2=(struct L *)malloc(l); p3=p2->pq=p1; p1->ph=p2; p1=p2; ...
31
15020
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
15021
struct student { char num[30]; char name[30]; char s; float grad1; float grad2; char add[30]; struct student *next,*prev; }; void main() { struct student *head,*temp,*end; head=(struct student *)malloc(sizeof(struct student)); temp=head; head->prev=0; while(1) { scanf("%s",temp->num); if(strcmp(temp...
31
15022
struct student { struct student *pre; char mess[500]; }; void main() { int n=0; struct student *p1,*p2,*p; p1=(struct student *)malloc(LEN); while(strcmp(gets(p1->mess),"end")!=0) { n=n+1; if(n==1) p1->pre=NULL; else p1->pre=p2; p2=p1; p1=(struct student *)malloc(LEN); } p=p2; do { print...
31
15023
struct stu { char inf[50]; struct stu *next; }; struct stu *head,*p1,*p2; int output(struct stu *point); int main() { p1=(struct stu *)malloc(sizeof(struct stu)); head=p1; while(gets((*p1).inf)!=NULL) { p2=(struct stu *)malloc(sizeof(struct stu)); (*p1).next=p2; p1=p2; } (*p1).next=NULL; output(head); ...
31
15024
struct student { char num[50]; char name[50]; char sex[1]; int age; float score; char address[50]; struct student *next; }; void main() { struct student *head,*p1,*p2; p1=p2=(struct student*)malloc(sizeof(struct student)); head=p1; scanf("%s%s%s%d%f%s",p1->num,p1->name,&p1->sex,&p1->age,&p1->score,p1->addres...
31
15025
struct student { char str[1000]; struct student *next; }; void main() { struct student a[1000],*p,*head; int i,j,t; for(i=0;;i++) { gets(a[i].str); if(a[i].str[0]=='e') break; } for(j=i-1;j>=0;j--) { head=&a[i-1]; /*???a[i-1]???a[i]????????*/ a[j].next=&a[j-1]; /*????????end*/ a[0].next...
31
15026
main() { struct inf { struct inf *pLate; char num[20]; char nam[20]; char gen; int old[20]; int sco[20]; char loc[20]; struct inf *pNext; }; int i,j,k; struct inf *pHeader; pHeader=(struct inf *)malloc(sizeof(struct inf)); struct inf *p; struct inf *p1=NULL; p=pHeader; pHeader->pLate=NULL; for(i=0...
31
15027
struct stud { char num[20]; char name[20]; char sex; int age; char grade[10]; char add[30]; struct stud *next; }; struct stud *creat(void) { struct stud *head,*p1,*p2; p1=p2=(struct stud *)malloc(sizeof(struct stud)); p2->next=0; head=p1; for(;;) { scanf("%s",p1->num); if(*(p1->num+2)=='d') return h...
31
15028
struct student { char id[100]; char name[100]; char sex; int age; char score[100]; char addr[100]; struct student *pre,*next; }; void main() { struct student *p1,*p2,*head1,*head2; int n=0; char temp[100]; head1=NULL; p1=p2=NULL; while(scanf("%s",temp),strcmp(temp,"end")!=0) { n=n+1; p1=(struct s...
31
15029
struct stu { char num[30]; char name[30]; char sex; int age; float score; char add[30]; struct stu *next; }; struct stu *p1,*p2,*head; int main() { void result(struct stu*); p1=p2=(struct stu*) malloc(sizeof(struct stu)); scanf("%s ",p1->num); scanf("%s ",p1->name); scanf("%c",&(p1->sex)); scanf("%d",...
31
15030
main() { char a[2000][20],b[2000][20],c[2000][20],d[2000][20],e[2000][20],s[2000][20]; int i=0,j; scanf("%s",a[i]); while(1) { scanf("%s",b[i]); scanf("%s",c[i]); scanf("%s",e[i]); scanf("%s",s[i]); scanf("%s",d[i]); i++; scanf("%s",a[i]); if(a[i][0]=='e') break; } for(j=i-1;j>=0;j--) { printf("%s %s %s %s %s %s\n",a[j...
31
15031
int main() { struct student { char imfor[100]; }; int n=1,m; struct student *p1,*p3[600]; p1=p3[0]=(struct student *)malloc(sizeof(struct student)); gets(p1->imfor); while (p1->imfor[0]!='e') { p1=(struct student * )malloc(sizeof(struct student)); p3[n]=p1; n++; gets(p1->imfor); } for (m=n-2;m>=0;...
31
15032
struct student{ struct student *pre; char s[100]; struct student *next; }; struct student *creat() { struct student *p1,*p2; p1=(struct student*)malloc(len); gets(p1->s); p1->pre=NULL; p1->next=NULL; p2=p1; while(strcmp(p1->s,"end")) { p1=(struct student*)malloc(len); gets(p1->s); p1->pre=p2; p...
31
15033
struct student { char stu[100]; struct student *next; }; int n; struct student *creat(void) { struct student *head,*p1,*p2,*toil; n=0; head=NULL; p1=p2=(struct student*)malloc(LEN); gets(p1->stu); while(strcmp(p1->stu,"end")!=0) { n=n+1; if(n==1)head=p1; else p1->next=p2; p2=p1; p1=(struct student*)...
31
15034
void main() { char a[200]; gets(a); if(a[0]-'e'||a[1]-'n'||a[2]-'d') { main(); puts(a); } }
31
15035
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
15036
struct student { /*char id[20]; char name[10]; char sex; int age; int score; char addr[20];*/ char s[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); //scanf("%s",p1->id); gets(p1->s); /...
31
15037
struct Student { struct Student *previous; char no[20]; char name[30]; char sex; int age; float score; char address[30]; }; struct Student *creat() { struct Student *end,*p1,*p2; p1=NULL; for(;;) { p2=p1; p1=(struct Student*)malloc(LEN); p1->previous=p2; scanf("%s",p1->no); if(strcmp...
31
15038
struct student { char a[100]; struct student *pre; }; struct student *creat() { struct student *p1;struct student *p2; struct student *head; head=(struct student *) malloc(sizeof(struct student)); p1=p2=head; head->pre=0; while(1) { p1=(struct student *)malloc(sizeof(struct student)); p1->pre=p2; gets(p1...
31
15039
struct seqs//???? { char num[10]; char name[20]; char sex; int age; float score;//??????? char addr[100]; struct seqs *next; }; struct seqs *build()//???? { struct seqs *head,*newnode,*p; newnode=(struct seqs *)malloc(len); newnode->next=NULL;//???????? scanf("%s %s %c %d %f %s",newnode->num...
31
15040
int main(){ struct { char No[100]; char name[20]; char sex; int age; float grade; char address[20]; } stu[10000]; int i; cin>>stu[0].No>>stu[0].name>>stu[0].sex>>stu[0].age>>stu[0].grade>>stu[0].address; //??????? for(i=1;stu[i-1].No[0]!='e';i++){ cin>>stu[i].No; if(stu[i].No[0]!='e') //????end??...
31
15041
struct student { char num[200]; char name[100]; char xingbie; int age; char score[200]; char add[200]; struct student *next; }; struct student*creat() { struct student *p1,*head; p1=(struct student*)malloc(LEN); head=NULL; scanf("%s",p1->num); if(strcmp(p1->num,"end")==0) return head; scanf("%s %c %d %s %...
31
15042
struct stu { char num[1000]; struct stu *pre; }*phead,*p1,*p2,*pend; void print(void) { struct stu *p; for(p=pend;p!=phead;) { puts(p->num); p=p->pre; } puts(p->num); } main() { for(p1=p2=phead=(struct stu*)malloc(sizeof(struct stu));;) { gets(p1->num); if(p1->num[0]=='e') { pend=p1->pre; brea...
31
15043
struct student { char number[20]; char name[20]; char sex[2]; int year; float score; char address[100]; struct student *next; }; int main() { struct student *p1,*p2; p1=(struct student *)malloc(sizeof(struct student)); p1->next=NULL; scanf("%s",p1->number); while(p1->number[0]!='e') { scanf("%s%s%d%f%s",...
31
15044
struct Student { char num[10]; char nam[20]; char sex[2]; char age[3]; char sco[6]; char add[12]; struct Student*next; }; int n; struct Student*creat(void) { struct Student*head; struct Student*p; p=(struct Student*)malloc(LEN); head=NULL;n=0; scanf("%s",p->num); while(strcmp(p->num,"end")!=0) { ...
31
15045
struct student {char number[100]; char name[100]; char sex; int age; char score[20]; char address[100]; struct student *nest; struct student *front; }; void main() { struct student *p1,*p2; int n=0; p1=p2=(struct student*)malloc(LEN); p1->front=NULL; scanf("%s",&p1->number); while(p1->number[0]!='e'||p1->number[...
31
15046
struct student{ char num[20],name[20],add[100],sex[2]; int age; float score; struct student *next; }; void main() { struct student *p1,*p,*p2; p=(struct student*)malloc(sizeof(struct student)); p->next=NULL; scanf("%s",p->num); while(p->num[0]!='e') { scanf("%s%s%d%f%s",p->name,p->sex,&p->age,&p->score,p->a...
31
15047
struct student { char str[100]; struct student *next; }; struct student *creat(void) { struct student *head,*p1,*p2; p1=(struct student*)malloc(len); gets(p1->str); if(strcmp(p1->str,"end")==0) { free(p1); head=NULL; return head; } else { p1->next=NULL; head=p1; p2=p1; do { p1=(struct...
31
15048
struct student { char all[100]; struct student *next; }; struct student *creat(void) { struct student *head; struct student *p,*q; int t=0; head=(struct student*) malloc (sizeof (struct student)); gets(head->all); q=head; head->next=NULL; do { if(t>0) { p->next=q; q=p; } p=(struct student*) malloc (siz...
31
15049
struct student { char a[10]; char b[20]; char c; int d; float e; char f[19]; struct student * next; }; int main() { struct student *p1,*p2; p1=(struct student *)malloc(len); scanf("%s %s %c %d %f %s",p1->a,p1->b,&p1->c,&p1->d,&p1->e,p1->f); p1->next=NULL; p2=p1; while(1) { p1=(struct student...
31
15050
typedef struct node { char s[100]; struct node *next; }node; int main() { node *p1,*p2,*head; head=(node*)malloc(sizeof(node)); p1=head; p2=head; int i=0; while(1) { p2=(node*)malloc(sizeof(node)); if(i==0) p2->next=NULL; else p2->next=p1; p1=p2;...
31
15051
struct student { char num[1000]; struct student *next; }; int n=0; struct student *creat() { struct student *head,*p1,*p2; p1=p2=(struct student*)malloc(LEN); gets(p1->num); while (strcmp(p1->num,"end")!=0) { n=n+1; if (n==1) head=p1; else p2->next=...
31
15052
int n; struct stu {char num[10]; char name[20]; char sex; int age; float score; char add[30]; struct stu *next; }; struct stu *create() { struct stu *head, *p1,*p2; n=1; p1=(struct stu *)malloc(LEN); scanf("%s %s %c %d %f %s", &p1->num,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add); p1->next=NULL; head ...
31
15053
struct node { struct node *last; char id[15]; char name[25]; char sex; int age; char score[10]; char addr[15]; struct node *next; }; int n=1; struct node *newnode() { struct node *head=NULL,*New,*This; do { New=(struct node *)malloc(sizeof(struct node)); scanf("%s",New->id); if(n==1) { head=New;...
31
15054
struct Student { char num[20]; char name[20]; char sex; int age; char score[20]; char add[20]; struct Student *next; }; struct Student *creat() { int i; struct Student *head,*p1,*p2; p1=(struct Student *)malloc(LEN); scanf("%s",p1->num); for(i=0;p1->num[0]!='e';i++) { head=p1; scanf("%s %c %d %s %s",p1...
31
15055
//#define LEN sizeof(struct student) struct student { char num[50]; struct student * next; }; int n; char end[4]="end"; struct student * creat(void) { struct student * p1,*p2; n=0; p1=p2=(struct student*)malloc(sizeof(struct student));// gets(p1->num); while(strcmp(end,p1->num)!=0)// { n=n+1; if(n==1...
31
15056
struct student { char num[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->num); head=NULL; while(strcmp(p1->num,"end")) { n++; p1->next=head; head=p1; p1=(struct stu...
31
15057
struct student{ char num[10]; char name[20]; char gd; int age; float sc; char adr[10]; struct student *next; }; struct student *append() { struct student *head,*p1,*p2=NULL; while(1) { p1=(struct student*)malloc(sizeof(struct student)); scanf("%s",p1->num); if (p1->num[0]=='e') { head=p2; ...
31
15058
struct student { char num[10]; char name[20]; char c; int age; char score[10]; char addr[20]; struct student*next; }; void main() { struct student *p1,*p2,*p,*head; p1=(struct student*)malloc(LEN); scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->c,&p1->age,p1->score,p1->addr); p1->next=NULL; do { p2=(s...
31
15059
struct student { char number[20]; char name[20]; char c; int age; float score; char address[30]; struct student *next; }; int n; struct student *creat(void) { struct student *head; struct student *p1,*p2; int m; n=0; p1=p2=(struct student*)malloc(LEN); head=NULL; scanf("%s",p1->number); ...
31
15060
struct student { char name[32],sex,address[32],id[10],score[10]; int age; struct student *next; }; struct student *create() { struct student *head=NULL,*p1,*p2; char ch[10]; p1=p2=(struct student*)malloc(Len); scanf("%s %s %c %d %s %s",p1->id,p1->name,&p1->sex,&p1->age,p1->score,p1->address)...
31
15061
main() { struct student { char num[100]; char name[100]; char sex[10]; char age[10]; char score[10]; char address[100]; struct student *next; }; struct student *head,*p1; p1=(struct student*)malloc(sizeof(struct student)); head=NULL; scanf("%s",p1->num); while(strcmp(p1->num,"end")!=0) { scanf(...
31
15062
main() { int n=0; struct b { char a[60]; }d,*q[10000]; while(1) { gets(d.a); if(d.a[0]=='e') break; q[n]=(struct b *)malloc(sizeof(struct b)); *q[n]=d; n++; } while(n--) { puts(q[n]->a); } }
31
15063
struct num {int nianling; float defen; char q[200],w[100],xingbie,xuehao[200]; struct num *next; }; struct num *crea() {long i; struct num *head; struct num *p1,*p2; p1=p2=(struct num *)malloc(LEN); head=p1; scanf("%s %s %c %d %f %s",&p1->xuehao,&p1->q,&p1->xingbie,&p1->nianling,&p1->defen,&p1->w); head...
31
15064
struct student { char num[10]; char name[20]; char sex; int age; char score[10]; char address[50]; struct student *next; }; void main() { struct student *head,*p,*s; head=(struct student *)malloc(sizeof(struct student)); head->next=NULL; p=head->next; for(;;) { s=(struct student *)malloc(sizeof(struc...
31
15065
struct Student { char no[10]; char name[20]; char sex; int age; char score[7]; char add[15]; struct Student *next; }; int main() { struct Student *p[1000],*head; int i; for(i=0; ;i++) { p[i]=(struct Student *)malloc(LEN); scanf("%s",p[i]->no); if(strcmp(p[i]->no,"end")==0) { head=p[i-1];//hea...
31
15066
struct student { char num[10]; char s1[20]; char sex; int age; char mark[20]; char s2[20]; struct student*next; } *p1,*p2;//????????????????????????// int n; //????// struct student * creat(void) { struct student * head; n=0; p1 = p2 = (struct student * )malloc(LEN); sc...
31
15067
struct stu { char num[15]; char name[20]; char sex; int year; char score[20]; char adr[15]; struct stu *next; }*p,*q,*head,*newhead,*ne; struct stu *creat(void) { char a[15]; head=null; scanf("%s",&a); while(strlen(a)!=3) { p=(struct stu *)malloc(l); strcpy(p->num,a); scanf("%s %c %d %s %s",p->name...
31
15068
struct stu { char num[10]; char name[20]; char sex; int age...
31
15069
struct people { char num[20]; char name[20]; char sex; char age[5]; char score[10]; char address[30]; }; struct people child[1000]; void main() { int i; for(i=0;;i++) { scanf("%s",child[i].num); if (strcmp(child[i].num,"end")==0) break; scanf("%s %c%s%s%s",child[i].name,&child[i].sex,child[i].age,chi...
31
15070
struct student{ char stu[50]; struct student *next; }; struct student *Create(); void Insert(struct student *head,struct student *newnode); void Print(struct student *head); int main(){ struct student tmp; struct student *head; head=Create(); gets(tmp.stu); while(strcmp(tmp.stu,"end")!=0){ In...
31
15071
main() { struct student { char num[20]; char name[20]; char sex; int age; float score; char ad[20]; struct student *next; }; struct student *head,*p1,*p2; int n=0; p1=p2=( struc...
31
15072
struct sd {char xh[100];char xm[100];char xb;int nl;double df;char dz[10];struct sd*before;}; struct sd* cre() {struct sd *p1,*p2=NULL; while(1){p1=(struct sd*)(malloc(sizeof(struct sd))); scanf("%s",p1->xh); if(strcmp(p1->xh,"end")==0)break; else{ p1->before=p2;p2=p1; scanf("%s %c %d %lf %s",p1->xm,&p1->xb,&p1->...
31
15073
struct student { char stuID[20]; char name[20]; char sex; int age; char score[10]; char add[20]; }; int main() { int i,j; struct student stu[5000]; scanf("%s %s %c %d %s %s",stu[0].stuID,stu[0].name,&stu[0].sex,&stu[0].age,stu[0].score,stu[0].add); i=0; if(strlen(stu[i].stuID)>=3) { while(1) { i++; sc...
31
15074
struct student { char data[500]; struct student *former; }; int n; struct student *create() { struct student *tail; struct student *p1,*p2; n=0; p1=p2=(struct student *)malloc(sizeof(struct student)); gets(p1->data); tail=NULL; while(strcmp(p1->data,"end")!=0) { n=n+1; ...
31
15075
int main() { struct student { char ID[30]; char name[30]; char sex; int age; float score; char address[20]; }message[1000]; int num=0; for(;;num++) { cin>>message[num].ID; if (message[num].ID[0]!='e')//?????? {cin>>message[num].name>>message[num].sex>>message[num].age>>message[num].score>>messa...
31
15076
struct student{ char xh[20]; char name[20]; char sex; int age; float score; char dizhi[30]; struct student *next; }; struct student *append(void) {int n; struct student *head,*newnode,*thisnode=NULL; for (n=1;;n++) {newnode=(struct student*)malloc(sizeof(struct student)); scanf("%s",&newnode->xh); if (new...
31
15077
struct student { char num[50],ming[100]; struct student *pro; }; int n; struct student *tail; struct student *creat() { struct student *head; struct student *p1,*p2; int i; i=0; p1=p2=(struct student *)malloc(len); scanf("%s",p1->num); head=0; while (strcmp(p1->num,"end")) { gets(p1->ming); i++; i...
31
15078
struct stu {char info[50]; struct stu *next; }*p1,*p2; int n; struct stu *creat(void) {struct stu *head=NULL; n=0; p1=p2=(struct stu *)malloc(sizeof(struct stu));//??????? gets(p1->info); while(strcmp(p1->info,"end")!=0) {n++; if(n==1) head=p1; else p2->next=p1; p2=p1; p1=(struct stu *)malloc(sizeof(struct stu)); gets(...
31
15079
struct link { char s[100]; struct link *next; struct link *last; } ; struct link *create() { struct link *last,*head,*p; char s[100]; head=(struct link*)malloc(LEN); last=head; do { gets(s); if (strlen(s)==3) break; p=(struct link*)malloc(LEN); strcpy(p->s,s); last->next=p; p->last=last; last=p; ...
31
15080
struct student { char inf[50]; struct student *next; }; int main() { struct student *head,*p; p=(struct student*)malloc(LEN); gets(p->inf); head=NULL; while (p->inf[0]!='e') { p->next=head; head=p; p=(struct student*)malloc(LEN); gets(p->inf); } p=head; while(true) { printf("%s",p->inf); p=p->next...
31
15081
struct student { char id[50]; char name[50]; char sex; int age; double grade; char a[20]; struct student *next; }; void main() { struct student *h,*p,*q; int n=0; p=(struct student*)malloc(LEN); scanf("%s",p->id); while(p->id[0]!='e') { ...
31
15082
struct student { char str[100]; struct student *next; }; int isequal(char *a); int main() { struct student *head,*p1,*p2; p1=(struct student*)malloc(sizeof(struct student)); gets(p1->str); p1->next=NULL; if(isequal(p1->str)) { free(p1); head=NULL; } else { head=p1; p2=p1; do { p1=(struct st...
31
15083
struct student { char num[30]; char name[30]; char sex; int age; char score[30]; char add[30]; struct student *next; }; int n=0; void main() { struct student *head,*p1,*p2; p1=p2=(struct student *)malloc(LEN); scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->sex,&p1->age,p1->score,p1->add); while(1) { n++;...
31
15084
void main() { struct stu { char num[21]; char name[31]; char sex[2]; int age; float score; char address[31]; struct stu *next; struct stu *pre; }; struct stu *head,*p1,*p2,*tail; head=(struct stu *)malloc(sizeof(struct stu)); p1=head; p2=p1; p1->pre=NULL; scanf("%s",&p1->num); if (strcmp(p1->n...
31
15085
struct link { char a[10][100]; struct link *next; }; struct link *now,*past; int i,n=1; void build() { while (1) { now=(struct link*)malloc(sizeof(struct link)); scanf("%s",now->a[0]); if (strcmp(now->a[0],"end")==0) return; for (i=1;i<6;i++) scanf("%s",now->a[i]); if (n==1) { now->next=NULL; } else now-...
31
15086
struct student { char num[10]; char name[20]; char sex; int age; char score[6]; char addr[20]; struct student *former; }; int n; struct student *create() { n=0; struct student *p1,*p2; p1=p2=(struct student*)malloc(LEN); scanf("%s",p1->num); while(p2->num[0]!='e') { n++; if(n==1) p1->former=NULL; ...
31
15087
struct stu{char id[20];char name[20];char sex;int age;char score[20];char address[20];struct stu *next;struct stu *former;}; struct stu *cr(void) {struct stu *head,*end; struct stu *p1,*p2; int i=0; p1=p2=(struct stu*)malloc(LEN); scanf("%s",&p1->id); if(strcmp(p1->id,"end")!=0) { scanf("%s %c %d %s %s",&p1->name...
31
15088
struct student { char num[100]; char name[100]; char sex[2]; int age; char score[20]; char addr[100]; struct student *next; }; struct student *creat(void) { struct student *head; struct student *p1,*p2=NULL; p1=(struct student*)malloc(LEN); scanf("%s",p1->num); if (strcmp(p1->num,"end")!=0) { scanf("%s%s...
31
15089
struct Student { char id[10]; char name[100]; char sex; char year[10]; char mark[10]; char ad[20]; }stu[1000]; int main() { int i,k=0; for(i=0;;i++) { scanf("%s ",stu[i].id); if(stu[i].id[0]=='e') {break;} else {scanf("%s %c %s %s %s\n",stu[i].name,&stu[i].sex,stu[i].year,stu[i].mark,stu[i].ad); k...
31
15090
struct Student { char id[9]; char name[20]; char gen; int age; char grade[10]; char add[20]; struct Student *next; }; void main() { struct Student *head,*p2,*p1,*newstu,*newhead; int i,n=1; char e[]={"end"}; p1=p2=head=(struct Student*)malloc(sizeof(struct Student)); scanf("%s %s %c %d %s %s", &p1->id,&p1->name,&p1-...
31
15091
struct w {char id[100]; struct w *next; }; struct w *head,*new,*newhead,*p1,*p2; int i,n; struct w *create(void) { n=0; head=null; p1=p2=(struct w *)malloc(len); gets(p1->id); while(strcmp(p1->id,"end")!=0) { n++; if(n==1)head=p1; else p2->next=p1; p2=p1; p1=(struct w *)malloc(len); gets(p1->id); } p2...
31
15092
void main() { char stu[10000][100],tem[100]={'e','n','d'}; int i,j; for (i=0;i<10000;i++) { gets(stu[i]); if (strcmp(stu[i],tem)==0)break; } for(j=i-1;j>=0;--j) printf("%s\n",stu[j]); }
31
15093
int i=0; 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...
31
15094
struct Student { char ID[10]; char name[20]; char sex; int age; float score[20]; char add[20]; struct Student*next; }; int main() { struct Student a[1000],*head,*p; int i,j; for(i=0;;i++) { scanf("%s %s %c %d %s %s",a[i].ID,a[i].name,&a[i].sex,&a[i].age,a[i].score,a[i].add); if(a[i].I...
31
15095
int main() { int i,n; char a[MAX][MAX]; for(i=0; ;i++) { gets(a[i]); if(strcmp(a[i],"end")==0) break; } for(n=i-1;n>=0;n--) { puts(a[n]); } return 0; }
31
15096
struct Student { struct Student *prev; char number[30]; char name[30]; char gender; int age; double score; char address[30]; }; int main() { struct Student a,*p; scanf("%s%s %c%d%lf%s",a.number,a.name,&a.gender,&a.age,&a.score,a.address); p=(struct Student *)malloc(LEN); *p=a; (*p).prev=NULL; for(;1;) {...
31
15097
struct student { char num[10]; char name[20]; char gender[2]; int year; char score[10]; char ad[20]; struct student *next; }; int main() { int i,count=0; struct student *head,*p1,*p2,*p,*q,*temp; for(i=1;i<=10000;i++){ p1=(struct student *)malloc(sizeof(struct student)); scanf("%s",p1->num); if(strcmp(...
31
15098
struct stu { char num[15]; char name[20]; char gender; int age; char score[10]; char add[20]; struct stu *next; }; int n; struct stu *creat(void) { struct stu *head,*p,*q; p=q=(struct stu*)malloc(LEN); scanf ("%s%s %c %d %s%s",(*p).num,(*p).name,&(*p).gender,&(*p).age,(*p).score,(*p).add); for (n=0;(*p).gend...
31
15099
/* * justexp.cpp * * Created on: 2011-11-18 * Author: dell */ int main() { struct data { char num[200]; char name[200]; char gender; int age; float score; char add[200]; }student[2000]; int count=0; while(true) { memset(student[count].num,'\0',sizeof(student[count].num)); cin>>student[c...