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

请教一下为什么WA,3Q~

Posted by liusry at 2008-05-08 14:09:31 on Problem 2656
#include<iostream>
using namespace std;
int main()
{
   int n; 
   int a,b;
   int max = 8;
   int id = 0;
while(cin>>n)
 {
   if(n)
   {
       for(int i=0;i<n;i++)
       {
       cin>>a>>b;
       if(a+b>max)
        {
            max=a+b;
            id=i+1;
        }
       }
       cout<<id<<endl;
   }
   else
   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