label
stringlengths
1
2
index
stringlengths
1
5
code
stringlengths
87
8.24k
14
6800
struct info { int num; int chin; int math; struct info *next; }; struct info *create(int n) { int i; struct info *head,*p1,*p2; p1=(struct info*)malloc(sizeof(struct info)); scanf("%d %d %d",&p1->num,&p1->chin,&p1->math); p1->next=NULL; head=p1; p2=p1; i=1; do { p1=(struct info*)malloc(sizeof(struct ...
14
6801
void main() { long n; scanf("%ld",&n); struct student { int num; int chi; int math; int sum; }stu[100000]; int i; for(i=0;i<n;i++) { scanf("%d %d %d",&stu[i].num,&stu[i].chi,&stu[i].math); stu[i].sum=stu[i].chi+stu[i].math; } struct student blank; for(i=0;i<n;i++) { if(stu[i].sum>stu[0].sum) { ...
14
6802
struct student {int id; int chinese; int maths; int total; }; void main() { int n,i; struct student s,s1,s2,s3; scanf("%d",&n); s2.total=s1.total=s3.total=-1; for(i=0;i<n;i++) { scanf("%d %d %d",&s.id,&s.chinese,&s.maths); s.total=s.chinese+s.maths; if(s.total>s1.total) { s3=s2; s2=s1; s1=s...
14
6803
struct student { int num; float yuwen; float shuxue; float zongfen; }stu[student_num],*p[3]; void main() { void paixu(struct student *a,int n); int i,n; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%f%f",&stu[i].num,&stu[i].yuwen,&stu[i].shuxue); stu[i].zongfen=stu[i].yuwen+stu[i].shuxue; } paixu(stu,n); ...
14
6804
void main(int argc, char* argv[]) { struct student { int No; int chinese; int math; int total; } stu[100000]; int i,j,x,y,z,n; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&stu[i].No); scanf("%d",&stu[i].chinese); scanf("%d",&stu[i].math); stu[i].total=stu[i].chinese+stu[i].math; ...
14
6805
struct stud { int n; int chinese; int math; int total; struct stud *next; }; int tol; struct stud *creat(void) { struct stud *head,*p1,*p2; int i=1; p1=p2=(struct stud *)malloc(sizeof(struct stud)); head=p1; for(i=1;i<tol;i++) { scanf("%d%d%d",&p1->n,&p1->chinese,&p1->math); p1->total=(p1->math+p1->chine...
14
6806
int n; struct stu { int xh; int yw; int sx; int all; struct stu*next; }; struct stu *a,*b,*c,q,t,r; struct stu*creat() { struct stu *head; struct stu *p1,*p2; int i; p1=p2=(struct stu*)malloc(sizeof(struct stu)); scanf("%d%d%d",&p1->xh,&p1->yw,&p1->sx); p1->all=p1->yw+p1->sx; head=p1; a=b=c=head; for(i=1...
14
6807
int main() { int n; scanf ("%d",&n); struct student { int num; int chinese; int maths; }; struct student a[100000],temp; int i; for (i=0;i<n;i++) { scanf("%d",&a[i].num); scanf("%d",&a[i].chinese); scanf("%d",&a[i].maths); } ...
14
6808
int n; struct student { int num; int chinese; int math; int total; struct student *next; }; struct student *creat(int n) { struct student *head; struct student *p1,*p2; int i; if(n==0) { head=NULL; return(head); } else { p1=(struct student*)malloc(LEN); scanf("%d %d %d",&p1->num,&p1->chinese,&p1->...
14
6809
int main(int argc, char* argv[]) { struct r{int a;int b;int c;}r[99999]; int i,n,x=0,y=0,z=0,m1=0,m2=0,m3=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d%d",&r[i].a,&r[i].b,&r[i].c); } for(i=1;i<=n;i++) { if(r[i].b+r[i].c>m1) { m1=r[i].b+r[i].c; x=i; } } for(i=1;i<=n;i++) { if((r[...
14
6810
struct stu { int num; int ch; int math; struct stu* next; }; void main() { int n,m=0,max=0,max2=0,max3=0,no=0,no2=0,no3=0; struct stu*p; scanf("%d",&n); struct stu*p1,*p2,*head; p1=(struct stu*)malloc(LEN); scanf("%d%d%d",&p1->num,&p1->ch,&p1->math); head=NULL; while(n-1) { m=m+1; if(m==1) head=p...
14
6811
int main() { int n,i,j,k; struct student { int num; int chi; int math; int sum; }score[100000],temp; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d",&score[i].num,&score[i].chi,&score[i].math); score[i].sum=score[i].chi + score[i].math; } for(i=0;i<4;i++) { k=i; for(j=i+1;j<n;j++) if(score[j].sum>sc...
14
6812
int main() { int i,t=0,c=1,d=1,n,p=0,q=0,r=0,*b; struct pp { int x; int y; int z; }*s; scanf("%d",&n); b=(int*)malloc(sizeof(int)*n); s=(struct pp*)malloc(sizeof(int)*3*n); for(i=0;i<n;i++) { scanf("%d%d%d",&s[i].x,&s[i].y,&s[i].z); b[i]=((s[i].y)+(s[i].z)); } for(i=0;i<n;i++) { if(b[i]>t) { ...
14
6813
struct statistics { int num; int chinese; int math; int sum; } form[100000],temp; int main() { int n; scanf("%d",&n); int i,j; for(i=0;i<n;i++) { scanf("%d %d %d",&form[i].num,&form[i].chinese,&form[i].math); form[i].sum=form[i].chinese+form[i].math; } for(i=0;i<3&&i<n-1;i++) { int k=i; for...
14
6814
struct info { char num[10]; int chn; int math; struct info *next; }; int n,all; struct info *setup(void) { struct info *head,*p1,*p2; n=0; while(n<all) { p1=(struct info*)malloc(sizeof(struct info)); scanf("%s %d %d",p1->num,&p1->chn,&p1->math); n+=1; if(n==1)head=p1; else p2->next=p1; p2=p1; ...
14
6815
struct stud { int num; int score,score1,score2; struct stud *next; }head,end; void create(int n) { int i; struct stud *p1,*p2; head.next=NULL; for (i=0;i<=n-1;i++) { p1=(struct stud *)malloc(sizeof(struct stud)); if (!i) head.next=p1; else p2->next=p1; scanf("%d",&p1->num); scanf("%d",&p1->score1); ...
14
6816
int main() { int n,a[100000],b[100000],c[100000],sum[100000],i,t1,t2,t3,s1,s2,s3; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d%d%d",&a[i],&b[i],&c[i]); sum[i]=b[i]+c[i];} for(i=0,t1=0,s1=a[0];i<n;i++) {if(sum[i]>t1) {t1=sum[i]; s1=a[i];}} printf("%d %d\n",s1,t1); for(i=0,t2=0,s2=a[0];i<n;i++) {if(a[i]==s1)co...
14
6817
struct stu { int num; int chinese; int math; int sum; struct stu *next; }; void main() { void max(struct stu*); int n,i; struct stu *p,*q,*head; scanf("%d\n",&n); head=(struct stu*)malloc(sizeof(struct stu)); p=(struct stu*)malloc(sizeof(struct stu)); head->next=p; for(i=0;i<n;i++) { scanf("%d %d %d",&...
14
6818
int main(){ struct student{ //????student int StudentNumber; //?? int ChineseGrades; //???? int MathGrades; //???? int Total; //??? }; struct student Stu[100000],sTemp; //??????Stu?sTemp int n,i,j; //n??????i?j????? cin>>n; //?????? for (i=0;i<=n-1;i++){ //???????????????????????? cin>>Stu[i].St...
14
6819
struct student { int num; int sum; }stu[100000]; int main() { int n,i,j,t,a,b,m; int tempSum; int tempMax; int rank[3]={0}; scanf("%d",&n); //struct student * stu; //stu = (struct student *)malloc(sizeof(struct student) * n); for(i=0;i<n;i++) { tempSum = 0; ...
14
6820
struct stu { float num; float chi,mat,total; struct stu *next; }; struct stu *creat(int n) { int i; struct stu *head,*p1,*p2; for(i=0;i<n;i++) { p1=(struct stu*)malloc(sizeof(struct stu)); scanf("%f %f %f",&p1->num,&p1->chi,&p1->mat); p1->total=p1->chi+p1->mat...
14
6821
void main() { struct student { int num,sum; } stu[100000]; int n,i,j,k,a,b,t; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d %d %d",&stu[i].num,&a,&b); stu[i].sum=a+b; } for (i=0;i<3;i++) for (j=n-i-1;j>0;j--) if (stu[j].sum>stu[j-1].sum) { t=stu[j].sum;stu[j].sum=stu[j-1].sum;stu...
14
6822
struct Student { long id; int chn; int mth; int total; }; void main() { struct Student *p1,*top1,*top2,*top3,*temp; int i; long int n; scanf("%ld",&n); top1=(struct Student*)malloc(sizeof(struct Student)); top2=(struct Student*)malloc(sizeof(struct Student)); top3=(struct Student*)malloc(sizeof(struct Student)); temp=...
14
6823
struct student { int id; int math; int chinese; int sum; }stu[100000]; int main(int argc, char* argv[]) { int i , n ; int max1=0,max2=0,max3=0; int maxid1=0,maxid2=0,maxid3=0; scanf("%d", &n ); for ( i = 0 ; i < n ; i ++ ) { scanf("%d %d %d", &stu[i].id , &stu[i].chinese ,&stu[i].math ); stu[i].sum = s...
14
6824
struct stu { int num; int yu; int shu; int tol; struct stu *next; }; int n; struct stu *creat(void) { struct stu *p1,*p2,*head,*p; int i,k; p1=p2=(struct stu *)malloc(sizeof(struct stu)); scanf("%d %d %d",&p1->num,&p1->yu,&p1->shu); p1->tol=p1->yu+p1->shu; p1->next=0; head=p1; p=p1; p1=(struct stu *)mall...
14
6825
int main() { int i,n,math,chinese,std_num; int first,second,third; int score[3]={-1,-1,-1}; scanf("%d",&n); first=0;second=0;third=0; for(i=0;i<n;i++){ scanf("%d",&std_num); scanf("%d",&chinese); scanf("%d",&math); if (chinese+math>score[0]){ third =se...
14
6826
struct student { long num; int chi; int math; int add; }; struct student stu[100000]; void main() { int m,k,n,i,j; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%ld %d %d",&stu[i].num,&stu[i].chi,&stu[i].math); stu[i].add=stu[i].chi+stu[i].math; } for(j=0;j<3;j++) for(i=n-1;i>0;i--) { if(stu[i].add>stu[i-1].add) { ...
14
6827
main() { int i,n,t[3]={0},u[3]={0}; struct student { long int ID; int math; int chinese; int a; }stu[100000]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d",&stu[i].ID,&stu[i].math,&stu[i].chinese); stu[i].a=stu[i].math...
14
6828
int main() { struct student { int num; int chinese; int math; int sum; }stu[100000],t; int n; int i; int k; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d",&stu[i].num,&stu[i].chinese,&stu[i].math); stu[i].sum=stu[i].chinese+stu[i].math; } for(k=n-1;k>n-4;k--)...
14
6829
int main() { int n,i,max1=0,max2=0,max3=0,t1=0,t2=0,t3=0; int ID[100000],y[100000],m[100000],s[100000]; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d %d %d",&ID[i],&y[i],&m[i]); for(i=0;i<n;i++) s[i]=y[i]+m[i]; for(i=0;i<n;i++) { if(max1<s[i]) { max1=s[i]; t1=i; } } s...
14
6830
struct student{ int No; int yuwen; int shuxue; int sum; }; int main(){ int n,i,k,e,f; scanf("%d",&n); struct student *stu=(struct student*)malloc(sizeof(int)*4*n); for(i=0;i<n;i++){ scanf("%d%d%d",&stu[i].No,&stu[i].yuwen,&stu[i].shuxue); stu[i].sum=stu[i].yuwen+stu[i].shuxue; } for(k=0;k<3;k...
14
6831
int main() { int a[3], n,c,b,d,g[3], i,temp; int j = 0; scanf("%d",&n); for(i = 0; i < 3; i++) { scanf("%d %d %d", &d,&b,&c); g[i] = d; a[i] = b+c; } for (i = 0; i < 3 - 1; i++) for (j = 0; j < 3 - 1 - i; j++) if (a[j] < a[j+1]) { temp = a[j] ; a[j] = a[j+1]; a[j+1] = temp; temp = g...
14
6832
struct student { int id; int score1; int score2; struct student *next; }; struct student *head; struct student *creat(int x) { struct student *p1,*p2; p1=p2=(struct student *)malloc(LEN); scanf("%d %d %d",&p1->id,&p1->score1,&p1->score2); head=0; while(p1->id<x) { if(p1->id==1) head=p1; else p2->nex...
14
6833
int main() { int n; scanf("%d\n",&n); struct student{ int id; int yu,shu; } stu[100000]; int i; int s1=0,s2=0,s3=0; int x1=0,x2=0,x3=0; for(i=0;i<n;i++) { scanf("%d %d %d\n",&stu[i].id,&stu[i].yu,&stu[i].shu); } int s,x; for(i=0;i<n;i++...
14
6834
struct student { int num; int chi; int mat; int sum; }stu[100000]; void main() { int i,n,max=0,m,k; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d %d %d",&stu[i].num,&stu[i].chi,&stu[i].mat);stu[i].sum=stu[i].chi+stu[i].mat;} for(k=0;k<3;k++) { for(i=0;i<n;i++) if(stu[i].sum>max) {max=stu[i].sum;m=i;} ...
14
6835
struct student { int id; int math; int chinese; int zongfen; }; main() { int n,i=1,j; int a[100001]; struct student stu[100001]; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%d %d %d",&stu[i].id,&stu[i].math,&stu[i].chinese); stu[i].zong...
14
6836
struct student { char xuehao[100]; int yuwen; int shuxue; int sum; }; int main() { int n,i,j,l,m; struct student stu[100000]; struct student temp; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%s",stu[i].xuehao); scanf("%d %d",&stu[i].yuwen,&stu[i].shuxue); stu[i].sum=stu[i].yuwen+stu[i].shuxue; ...
14
6837
void main() { int i,n,m; scanf("%d\n",&n); int j,b[100000]={0},t,s; struct student { int num; int lang; int math; }; struct student a[100000]; for(i=0;i<n;i++) scanf("%d %d %d\n",&a[i].num,&a[i].lang,&a[i].math); for(i=0;i<n;i++) b[i]=a[i].lang+a[i].math; for(j=0;j<3;j++) for(i=1;i<n-j;i++) i...
14
6838
void main() { int i,j,n,k; struct student { int num; int score1; int score2; int t; }stu[100000],m1,m2,m3; scanf("%d\n",&n); for(i=0;i<n;i++) { scanf("%d %d %d\n",&stu[i].num,&stu[i].score1,&stu[i].score2); stu[i].t=stu[i].score1+stu[i].score2; } m1=stu[0]; m2=stu[0]; m3=stu[...
14
6839
struct student { int num,cn,math,sum,rank; struct student *next; }; int n; struct student * creat(void) { int i=1; struct student *head; struct student *p1,*p2; p1=p2=(struct student *)malloc(LEN); scanf("%d %d %d",&p1->num,&p1->cn,&p1->math); head=p1; do { p2=p1; if(i==n) break; p1=(struct student...
14
6840
struct student { int id; char yw;char sx;int zf;int pm;}; int main() { struct student a[100000],b[2]; int n,i,j; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d%d%d",&a[i].id,&a[i].yw,&a[i].sx); for(i=0;i<n;i++) a[i].zf=a[i].yw+a[i].sx; j=0; for(i=0;i<n;i++) if(a[i].zf>j) {j=a[i].zf;b[0]=a[i];} printf("%d %d\n",b[0].id,b[0]...
14
6841
/* * statistics of scores.cpp * * Created on: 2011-12-11 * Author: Administrator */ struct stu { int Num; int scoreC; int scoreM; int all; }; struct stu stu[100005]; void fsort(int first,int last) { int chosen1,chosen2,p,q; if(first>=last){return;} chosen1=stu[first].all; chosen2=stu[first].Nu...
14
6842
struct f{ int a; int b; int c;}st[100000],tp; int main(){ int n,i,ii,j,d,a,b,c; char cc; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d%d%d",&st[i].a,&st[i].b,&st[i].c); st[i].b+=st[i].c; } for(i=1;i<=3;i++){ for(j=i+1;j<=n;j++){ if(st[j].b>st[i].b){ tp=st[i]; st[i]=st[j]; st[j]=tp;}}} for(i...
14
6843
struct Student { int num; int chinese; int math; }sdu[99999]; int main() { int N,i,j,s,t,m; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d%d%d",&sdu[i].num,&sdu[i].chinese,&sdu[i].math); for(j=0;j<3;j++){ for(i=0;i<N-j-1;i++) if((sdu[i].chinese+sdu[i].ma...
14
6844
struct stu { int id; int eng; int math; int sum; struct stu *next; }*head,*p1,*p2; struct stu *order(int n) { int i,j,t; p1=head; for(i=0;i<3;i++) { p2=p1->next; for(j=i+1;j<n;j++) { if(p1->sum<p2->sum) { t=p1->id;p1->id=p2->id;p2->id=t; t=p1->sum;p1->sum=p2->sum;p2->sum=t; ...
14
6845
struct student { int num; int chinese; int math; int sum; }work[100001]; void qsort(int left,int right) { if (left>=right) return; int pindex=left,rindex=right; work[0]=work[left]; while (pindex<rindex) { while ((pindex<rindex)&&(work[rindex].sum>=work[0].sum)) rindex--; if (pindex<rindex){work...
14
6846
int main() { struct student { int num, ch, ma, grade; }sum[100000], h, m, t; int i, n; scanf("%d", &n); for(i=0;i<n;i++) { scanf("%d%d%d", &sum[i].num, &sum[i].ch, &sum[i].ma); sum[i].grade=sum[i].ch+sum[i].ma; } h.grade=m.grade=t.grade=0; for(i=0;i<n;i++) { if(sum[i].grade>h.grade) { t=m...
14
6847
struct student { int num; double chi; double math; double total; }; int main() { struct student stu[100000]; struct student temp; int n,i,j,k; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%lf%lf",&stu[i].num,&stu[i].chi,&stu[i].math); stu[i].total=stu[i].chi+stu[i].math; } for(i=0;i<3;i++) { k=i; f...
14
6848
int main() { int num[3],sum[3]; int i,j,k,t,n,m; num[0]=num[1]=num[2]=sum[0]=sum[1]=sum[2]=-10000000; scanf("%d",&n); for(m=0;m<n;m++) { scanf("%d%d%d",&i,&j,&k); j+=k; if(sum[2]<j) { sum[2]=j; num[2]=i; if(sum[2]>sum[1]) { t=sum[2]; sum[2]=sum[1]; sum[1]=t; t=num[2]; num[2...
14
6849
struct student { int id; int c; int m; int t; } a[SIZE]; int cmp(const void*p1,const void*p2) { struct student*p3=(struct student*)p1; struct student*p4=(struct student*)p2; return -p3->t+p4->t; } int main(void) { int n, i; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d%d%d"...
14
6850
int main ( ) { int N , i ; cin >> N ; int Max1 = 0 , Max2 = 0 , Max3 = 0 , Nb[4] ; struct student { int Number ; int Chinese ; int Math ; int Total ; }people[111111]; for ( i = 1 ; i <= N ; i ++ ) { cin >> people[i].Number >> people[i].Chinese >> people[i].Math ; people[i].Total = people[i].Chinese + ...
14
6851
int main(int argc, char* argv[]) { long n; long num[99999],math[99999],china[99999],z[99999],i; long num1=2,num2=1,num3=0,m1=0,m2=0,m3=0; scanf("%ld",&n); for(i=1;i<=n;i++) { scanf("%ld",&num[i]); scanf("%ld",&math[i]); scanf("%ld",&china[i]); z[i]=math[i]+china[i]; if(z[i]>num3) { num1=num2; ...
14
6852
int main() { int n,i,num[100000],j,grade1[100000],grade2[100000],grade[100000],t1,t2; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d",&num[i],&grade1[i],&grade2[i]); grade[i]=grade1[i]+grade2[i]; } for(j=1;j<4;j++) { for(i=0;i<n-j;i++) { if(grade[i]>=grade[i+1]) { t1=grade[i]; grade[i]=...
14
6853
struct stu { int id; int ch; int mt; int total; }; struct stu stu_1[100000]; struct stu top1={0,0,0,0},top2={0,0,0,0},top3={0,0,0,0}; int main() { int n,i; struct stu tem; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d",&(stu_1[i].id),&(stu_1[i].ch),&(stu_1[i].mt)); stu_1[i].total=stu_1[i].ch...
14
6854
struct stu { int id; int c; int m; int t; }; int main() { int n,i,j,K; struct stu a[4]={0}; struct stu b[4]={0}; struct stu temp={0}; scanf("%d",&n); for(i=0;i<=(n-1);i++) { if(i<=2) {scanf("%d%d%d",&a[i].id,&a[i].c,&a[i].m); a[i].t=a[i].c+a[i].m; b[i]=a[i];} else { scanf("%d%d%d",&a[...
14
6855
struct student{ int num; int chin; int math; int sum; }tem_stu; int main() { int n,i; scanf("%d",&n); struct student *stu; stu=(struct student*)malloc(n*sizeof(struct student)); for(i=0;i<n;i++){ scanf("%d%d%d",&stu[i].num,&stu[i].chin,&stu[i].math); stu[i].sum=stu[i].chin+stu[i].math; } int j; for...
14
6856
struct student { int num; int chi; int math; struct student *next; }; struct student *creat(int n) { struct student *head,*p1,*p2; int i; p1=p2=(struct student *)malloc(LEN); scanf("%d %d %d",&p1->num,&p1->chi,&p1->math); head=p1; for(i=2;i<=n;i++) { p1=(struct student *)malloc(LEN); scanf("%d %d %d"...
14
6857
void main() { struct stu {int num; int chi; int mat; }stu[100000]; int n,i,max1,max2,max3,maxn1,maxn2,maxn3; int sum[100000]; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d",&stu[i].num); scanf("%d",&stu[i].chi); scanf("%d",&stu[i].mat); sum[i]=stu[i].chi+stu[i].mat; } ma...
14
6858
int main() { int n,i,m; int a,b,c; int j,k,v; int sum[100000]; int max1=0,max2=0,max3=0; int A[100000][1]; scanf ("%d",&n); for (i=1;i<=n;i++) { scanf ("%d %d %d",&m,&A[i][0],&A[i][1]); sum[i]=A[i][0]+A[i][1]; } for (j=1;j<=n;j++) { if (sum[j]>max1) {max1=sum[j]; a=j;} } for (k=1;k<=n;k++) { ...
14
6859
struct student { long num; int chi; int math; int sum; struct student *next; }; long n; void main() { struct student *creat(); struct student *head,*p,*q1,*q2,*q3; int a; scanf("%ld",&n); head=creat(); p=head; a=0; while(p!=NULL) { if(p->sum>a) { a=p->sum; q1=p; } p=p->next; } p=head; a=...
14
6860
int sum[1000000]; struct student{ int id; int Gra[2]; }stu[1000000]; int main() { int n; cin>>n; for(int i=0;i<n;i++) { cin>>stu[i].id>>stu[i].Gra[0]>>stu[i].Gra[1]; sum[i]=stu[i].Gra[0]+stu[i].Gra[1]; } int max=0,imax=0; for(int i=0;i<3;i+...
14
6861
struct student { int id; int c; int m; int s; struct student *next; }; struct student *creat(void) { struct student *head,*p1,*p2; int n,i; p1=p2=(struct student*)malloc(LEN); scanf("%d",&n); head=NULL; for(i=0;i<n;i++) { scanf("%d%d%d",&p1->id,&p1->c,&...
14
6862
int n,max1,xue1,max2,xue2,max3,xue3; struct chengji { int xh; int yw; int sx; int zf; struct chengji *next; }; void create() { struct chengji *head; struct chengji *p1; int i=0; while(i<n) { i++; if (i==1) head=p1; p1=(struct chengji *)malloc(len); sca...
14
6863
struct st {int I; int c; int m; } st[100000]; int main() { int n,i,j,k=0,a,b; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d %d %d",&st[i].I,&st[i].c,&st[i].m); } for (i=0;i<3;i++) { for(j=0;j<n;j++) { if (k<st[j].c+st[j].m) { k=st[j].c+st[j].m; a=st[j]...
14
6864
int stu [100000]; int main(int argc, char* argv[]) { int n,i,j,y,t,m; struct s{ int a; int b; int c; }stu[100000]; scanf ("%d",&n); for (i=0;i<n;i++) { scanf ("%d%d%d",&stu[i].a,&stu[i].b,&stu[i].c); } for (i=0;i<3;i++) { for (j=i+1;j<n;j++) { if ((stu[j].b+stu[j].c)>(stu[i].b+stu[i].c)) ...
14
6865
int s[100001]; int main() { int n,i,j; scanf("%d",&n); struct{ int id,chin,math,su; }s[100001]; for(i=0;i<n;i++) { scanf("%d%d%d",&s[i].id,&s[i].chin,&s[i].math); s[i].su=s[i].chin+s[i].math; } for(i=0;i<3;i++) { for(j=i+1;j<n;j++) { if(s[i].su<s[j].su) { s[100000]=s[i]; s[i]=s[j]...
14
6866
int main() { long n,i; int high[4]={0}; long higher[4]; struct student { long num; int yuwen; int shuxue; int total; }stu[100000]; scanf("%d",&n); for (i=1;i<=n;i++) { scanf("%d %d %d",&stu[i].num,&stu[i].yuwen,&stu[i].shuxue); ...
14
6867
int main() { long int n,a[100000][2]; int i,j,t,s; struct Student {int num; int yu; int shu; }; scanf("%d",&n); for(i=0;i<n;i++) { struct Student studenti; scanf("%d%d%d",&studenti.num,&studenti.yu,&studenti.shu); a[i][0]=studenti.num; a[i][1]=studenti.yu+studenti.shu; } for(i=0;i<3;i++) { for(j=0;...
14
6868
int main () { struct student { int num; int ch; int ma; int sum; }; struct student *p; int n, i, j, t1, t2, a1=0, a2=0, a3=0, k1, k2, k3; scanf ("%d", &n); p=(struct student *)malloc (n*sizeof (struct student)); for (i=0; i<n; i++) { scanf ("%d%d%d", &p[i].num, &p[i].ch, &p[i].ma); p[i].sum= p[i].ch+...
14
6869
int main() {int n,sum[100000],a,b,c; struct xues{int a,b,c;} s[100000]; scanf ("%d",&n); int i; for(i=0;i<n;i++){ scanf("%d%d%d",&s[i].a,&s[i].b,&s[i].c); sum[i]=s[i].b+s[i].c; } int fir=0,sec=0,thi=0; for(i=0;i<n;i++){ if(fir<sum[i]){ thi=sec; sec=fir; fir=sum[i]; c=b; b=a; a=s[i].a; }...
14
6870
struct student { int ID; int ch; int ma; }; void main() { struct student re[N]; int n; int i=0,j=0,rec; int total[N]; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d%d",&re[i].ID,&re[i].ch,&re[i].ma); total[i]=re[i].ch+re[i].ma; } int max=total[0]; for(i=0;i<n;i++) { if(max<total[i]) { max=total[i];...
14
6871
typedef struct { int d; int score; } student; int main() { int n, i, temp1, temp2; student a[100002]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d%d%d", &a[i].d, &temp1, &temp2); a[i].score = temp1 + temp2; } student max1, max2, max3; max1.d = max2.d = max3.d = -1; max1.score = max2.score = max...
14
6872
struct ace { char id[10]; int a; int b; }o[3],r; void main() { int n,i,s[3],m,j,v; char z[10]; scanf("%d",&n); scanf("%s %d %d",o[0].id,&o[0].a,&o[0].b); scanf("%s %d %d",o[1].id,&o[1].a,&o[1].b); scanf("%s %d %d",o[2].id,&o[2].a,&o[2].b); s[0]=o[0].a+o[0].b; s[1]=o[1].a+o[1].b; s[2]=o[2].a+o[2].b; for...
14
6873
struct statistics {int num; int chinese; int math; int sum;} form[100000],temp; int main() { int n; scanf("%d",&n); int i,j; for(i=0;i<n;i++) {scanf("%d %d %d",&form[i].num,&form[i].chinese,&form[i].math); form[i].sum=form[i].chinese+form[i].math;}for(i=0; i<3&&i<n-1;i++){int k=i;for(j=i+1;j<n;j++){if(form[j].sum>f...
14
6874
struct stu { long xh; int yw; int sx; int zh; struct stu *next; }; struct stu *scan() { long n; long num=0; struct stu *head,*p1,*p2; p1=p2=(struct stu *)malloc(sizeof (struct stu)); scanf("%ld",&n); // head=0; head=p1; while(num<n) { scanf("%ld",&p1->xh); scanf("%d",&p1->yw); scanf("%d",&p1->sx);...
14
6875
/* * xue sheng cheng ji tong ji.cpp * * Created on: 2010-12-26 * Author: taoshibo */ int main() { int n = 0, i = 0, j = 0; cin >> n; struct student {//?????????????? int stuid; int chin; int math; } stu[n], t; for (i = 0; i < n; i++) {//???? ??????? cin >> stu[i].stuid >> stu[i].chin >> stu[i].m...
14
6876
int main() { int id,chinese,math,total; int n,i,a=0,b=0,c=0,x=0,y=0,z=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d%d",&id,&chinese,&math); total=chinese+math; if(total>a) { c=b; z=y; b=a; y=x; a=total; x=id; } else if(total<=a&&total>b) { c=b; z=y; ...
14
6877
struct student { int n; int a; int b; int aver; }stu[100000]; void main() { int m,i,j,f,t; scanf("%d",&m); for(i=0;i<m;i++) { scanf("%d%d%d",&stu[i].n,&stu[i].a,&stu[i].b); } for(i=0;i<m;i++) { stu[i].aver=stu[i].a+stu[i].b; } for(i=0;i<3;i++) for(j=m-1-i;j>=0;j--) { if(stu[j].aver<stu[j+1].aver...
14
6878
void main() { struct student { int num; int a; int b; }stu[100000]; int n,i,sum=0,max1=0,max2=0,max3=0,t=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d",&stu[i].num,&stu[i].a,&stu[i].b); sum=stu[i].a+stu[i].b; if (sum>max1) {max3=max2;max2=max1;max1=sum;} else if ((sum<max1)&&(sum>max2)){max3=max2;max2=sum;}...
14
6879
struct student { char num[30]; float chi; float mat; float tot; struct student *next; }; struct student * creat(struct student *head,struct student *stud) { struct student *p0,*p1,*p2; p1=head; p0=stud; if(head==NULL) {head=p0;p0->next=NULL;} else {while((p0->tot<=p1->tot)&&(p1->next!=NULL)) {p2=p1;p1=p...
14
6880
int main() { struct student { int ID; int yuwen; int shuxue; int zongfen; }; struct student student[100000]; int n,i,max,maxID; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d %d %d",&student[i].ID,&student[i].yuwen,&student[i].shuxue); for(i=1;i<=n;i+...
14
6881
/* * ????????.cpp * * Created on: 2010-12-24 * Author: wangwei */ struct student { int id; int chinese; int math; int together; }stu[100000],t; int main() { int n,i,j; cin>>n; for(i=0;i<n;i++) { cin>>stu[i].id>>stu[i].chinese>>stu[i].math; stu[i].together=stu[i].chinese+stu[i].math; } for(i=0;i...
14
6882
int max=0; struct student { char id[20]; int chinese; int math; int sum; int flag; struct student *next; }; struct student *h; int n,i; struct student *creat() { struct student *head,*p1,*p2; i=0; p1=p2=(struct student*)malloc(LEN); scanf("%s %d %d",p1->id,&p1->chinese,&p1->math); p1->sum=p1->chinese+p1...
14
6883
int main() { struct student{int id,chin,math,z;}p[100000]; int id,math,chin,z,i,n,f,s,t,id1,id2,id3; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d%d",&id,&chin,&math); p[i].id=id; p[i].math=math; p[i].chin=chin; } for(i=0;i<n;i++) { id=p[i].id; math=p[i].math; chin=p[i].chin; z=math+chin; ...
14
6884
int main(int argc, char* argv[]) { int N,i,n[num],c[num],m[num],sum[num]; int x1=0,x2=0,x3=0,y1=0,y2=0,y3=0; scanf ("%d",&N); for (i=0;i<N;i++) { scanf ("%d%d%d",&n[i],&c[i],&m[i]); sum[i]=c[i]+m[i]; } for (i=0;i<N;i++) { if (sum[i]>x1) { x1=sum[i]; y1=i; } } for (i=0;i<N;i++) { if (sum[i]>...
14
6885
int main() { struct student {int ID; int YW; int SX; }; struct student stu[100000]; int ZF[100000]; int n; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d",&stu[i].ID); scanf("%d",&stu[i].YW); scanf("%d",&stu[i].SX); ZF[i]=stu[i].YW+stu[i].SX; } int a=0,b=0,c=0,A=0,B=0,C=0; for(int i=0;...
14
6886
main() { struct stdudent { int ID; int a; int b; int c; }d[100000]; int first,second,third; int n,i,j; int w,h,l; int k; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d",&d[i].ID,&d[i].a,&d[i].b); ...
14
6887
struct score { int ID; int chinese; int math; }; void main() { int n,i,*sum,max,p=0; //struct score s[100000]; struct score *s; scanf("%d",&n); s=(struct score *)malloc(sizeof(struct score)*n); sum=(int *)malloc(sizeof(int)*n); for(i=0;i<n;i++) scanf("%d%d%d",&s[i].ID,&s[i].chinese,&s[i].math); for(i=0;i<n...
14
6888
struct stu{ int a; int b; int c; struct stu *next; }; void main() { int n,i,j,max; struct stu *head,*p1,*p2; scanf("%d",&n); for(i=0;i<n;i++) { if(i==0) { head=p1=p2=(struct stu*)malloc(sizeof(struct stu)); scanf("%d %d %d",&p1->a,&p1->b,&p1->c); head=p1; p2=p1; } else { p1=(struct...
14
6889
struct student { int num; int chinese; int maths; struct student *next; }; int n,max0; struct student *creat(void) { struct student *head,*p1,*p2; int i; p1=p2=(struct student *)malloc(sizeof(struct student)); head=p1; for(i=1;i<n;i++) { scanf("%d%d%d",&p1->num,&p1->chinese,&p1->maths); p1=(struct stud...
14
6890
struct person { int num; int chinese; int math; int total; }student[110000]; int main() { int n, i, max1=0, count1=0, max2=0, count2=0, max3=0, count3=0, number=0, sum=0; scanf("%d", &n); for(i=0; i<n; i++) { scanf("%d", &student[i].num); scanf("%d", &student[i].chinese); scanf("%d", &student[i].math)...
14
6891
struct student { int num; int yuwen; int shuxue; struct student *next; }; int n; struct student *creat(int m) { struct student *head; struct student *p1,*p2; n=0; p1=p2=(struct student*)malloc(LEN); scanf("%d%d%d",&p1->num,&p1->yuwen,&p1->shuxue); head=NULL; while(m--) { n=n+1; ...
14
6892
typedef struct S{ int ID; int c; int m; int a; }S; int mycmp(const void*e1,const void*e2){ return ((S*)e2)->a - ((S*)e1)->a; } void main() { struct S stu[100010]; int i,j,n; scanf("%d",&n); for (i = 0;i < n;i++){ scanf("%d%d%d",&(stu + i)->ID,&(stu + i)->c,&(stu + i)->m); (stu + i)->a = (stu + i)-...
14
6893
struct w {int id; int ch; int ma; int sum; struct w *next; }; int i,n,k=1,max,s=0; struct w *head,*p1,*p2; struct w *make(void) { head=null; scanf("%d",&n); p1=p2=(struct w *)malloc(len); scanf("%d %d %d",&p1->id,&p1->ch,&p1->ma); for(k=1;k<n;k++) { if(k==1)head=p1; else p2->next=p1; p2=p1; p1=(struct w *...
14
6894
struct student { int number; int total; }; int main() { int n; cin>>n; struct student a[n]; int i,j,t; for(i=0;i<n;i++) {int b,c; cin>>a[i].number>>b>>c; a[i].total=b+c; } for(i=0;i<3;i++) { for(j=i;j<n;j++) { if(a[j].total>a[i].total) { t=a[i].total;a[i].total=a[j].total;a[j].to...
14
6895
struct student {int id; int chin; int math; int sum; }stu[100000]; int main() { int n,i,j,tem,temp; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d%d",&stu[i].id,&stu[i].chin,&stu[i].math); stu[i].sum=stu[i].chin+stu[i].math; } int max[3]={...
14
6896
struct stu { int num; int ch; int mt; int sum; struct stu*next; }; void main() { struct stu *p1,*p2,*p,*head; int n,max=0,max2=0,max3=0,no=0,no2=0,no3=0; scanf("%d",&n); p1=(struct stu*)malloc(LEN); scanf("%d %d %d",&p1->num,&p1->ch,&p1->mt); p1->sum=p1->ch+p1->mt; head=p1; p2=p1; while(n-1) { p1=(...
14
6897
struct student { char num[10]; float a,b,c; int t; struct student *next; }; int n; struct student *head; struct student *creat() { struct student *p1,*p2; int i; i=0; p1=p2=(struct student *)malloc(len); scanf("%s %f %f",&p1->num,&p1->a,&p1->b); p1->c=p1->a+p1->b; p1->t=0; head=null; while (i<n-1) { ...
14
6898
main() { int a[100],b[100],c[100],d[100],n,i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d %d %d",&a[i],&b[i],&c[i]); if(n==10) {printf("6 181\n"); printf("3 176\n"); printf("8 175\n");} else {printf("16533 198\n"); printf("60249 198\n"); printf("204...
14
6899
struct student { int num; int ch; int math; int total; struct student *next; }; int n; int t; struct student *creat(void) { struct student *head; struct student *p1,*p2; int i; scanf("%d",&n); head=p1=p2=(struct student*)malloc(LEN); scanf("%d%d%d",&p1->num,&p1->ch,&p1->math); p1->total=p1->ch+p1->math; fo...