Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

现在改过来了,可是还是错啊.?

Posted by clwey at 2006-04-02 15:49:34 on Problem 2691
In Reply To:Re:能帮我看看有什么情况没有考虑到么? Posted by:xfxyjwf at 2006-03-13 19:03:20
#include"stdio.h"
#include"string.h"
main(){
       int a,b,i,j,m,r,z=0,k;
       double n,t;
       char d[500],c[500],e[500];
       while(scanf("%d %d",&a,&b)==2){
            if(a==0)break;
            z++;
            t=0.0;r=0;
            for(i=0;i<a;i++){
                fflush(stdin);
				gets(d);
			}
            for(j=0;j<b;j++){
				fflush(stdin);
				gets(c);
                scanf("%f %d",&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++){
					fflush(stdin);
					gets(d);
				}
            }
            printf("RFP #%d\n%s\n\n",z,e);
       }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator