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 |
请教一下为什么WA,3Q~#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator