Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
能帮我看看有什么情况没有考虑到么?#include"stdio.h" #include"string.h" int main(){ int a,b,i,j,m,r,z=0,k; double n,t; char d[50],c[50],e[50]; while(scanf("%d %d",&a,&b)==2){ if(a==0)break; z++; t=0.0;r=0; for(i=0;i<a;i++) scanf("%s",d); for(j=0;j<b;j++){ scanf("%s %f %d",c,&n,&m); if(m>r){ strcpy(e,c); t=n; r=m; } else if(m==r){ if(n<t){ t=n; strcpy(e,c); } } for(k=0;k<m;k++)scanf("%s",d); } printf("RFP #%d\n%s\n\n",z,e); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator