POJ 2656
1 #include<iostream> 2 #include<stdio.h> 3 4 using namespace std; 5 6 int main() 7 { 8 //freopen("acm.acm","r",stdin); 9 int num; 10 int time; 11 int ans; 12 int a; 13 int b; 14 int max; 15 while(1) 16 { 17 max = 0; 18 time = 0; 19 ans = 0; 20 cin>>num; 21 if(num == 0) 22 break; 23 while(num --) 24 { 25 cin>>a; 26 cin>>b; 27 ++ time; 28 if(a + b > max && a + b > 8) 29 { 30 max = a + b; 31 ans = time; 32 } 33 } 34 cout<<ans<<endl; 35 } 36 }