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-03-13 18:40:45 on Problem 2691
#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:
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