poj2656

不高兴的津津……

View Code
#include <iostream>
#include
<cstdlib>
#include
<cstring>
#include
<cstdio>
using namespace std;

int main()
{
//freopen("D:\\t.txt", "r", stdin);
int n;
while (scanf("%d", &n) != EOF && n != 0)
{
int ans = 0;
int maxhour = 0;
for (int i = 1; i <= n; i++)
{
int a, b;
scanf(
"%d%d", &a, &b);
if (a + b > 8 && a + b > maxhour)
{
ans
= i;
maxhour
= a + b;
}
}
printf(
"%d\n", ans);
}
return 0;
}
原文地址:https://www.cnblogs.com/rainydays/p/2033827.html