POJ 2656 解题报告
2015-06-13 01:02
369 查看
简单题。
thestoryofsnow | 2656 | Accepted | 156K | 0MS | C++ |
/* 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; }
相关文章推荐
- __stdcall与__cdecl的区别
- vs2012下编译ezrgb24所想
- Codeforces Round #248 (Div. 2) (ABCD题解)
- Ubuntu 教程 - 更改 Ubuntu 使用语言
- 操作系统 ---进程管理7
- python之程序打包
- python之扩展
- [LeetCode] Invert Binary Tree 翻转二叉树
- python之测试
- python之万维网
- python之网络编程
- python之数据库支持
- POJ 1953 解题报告
- python之图形界面
- python之文件和素材
- 约书亚树的启示
- python之标准库
- sqlserver存储过程及易错点
- JS(JavaScript)脚本库的积累
- python之特殊方法、属性和迭代器