您的位置:首页 > 其它

POJ 2656 解题报告

2015-06-13 01:02 369 查看
简单题。

thestoryofsnow2656Accepted156K0MSC++
/*
ID: thestor1
LANG: C++
TASK: poj2656
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <limits>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cassert>

using namespace std;

int main()
{
int n;
while (scanf("%d", &n) && n)
{
int unhappiest = 0, maxstudyhours = 0;
for (int i = 0; i < n; ++i)
{
int school, supplementary;
scanf("%d%d", &school, &supplementary);
int studyhours = school + supplementary;
if (studyhours > 8)
{
if (studyhours > maxstudyhours)
{
maxstudyhours = studyhours;
unhappiest = i + 1;
}
}
}

printf("%d\n", unhappiest);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: