码迷,mamicode.com
首页 > 其他好文 > 详细

谁是最好的Coder

时间:2014-11-02 18:11:18      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   os   for   sp   strong   数据   

谁是最好的Coder

描述

计科班有很多Coder,帅帅想知道自己是不是综合实力最强的coder。
帅帅喜欢帅,所以他选了帅气和编程水平作为评选标准。
每个同学的综合得分是帅气程度得分与编程水平得分的和。
他希望你能写一个程序帮他一下。
 
输入
数据有多组。 输入一个数n,代表计科班的总人数。 接下来有n行数,一行数有两个数a,b。 其中a代表该同学的编程水平,b代表该同学的帅气程度。 n=0表示输入结束。
输出
每组数据占一行,输出所有同学中综合得分最高的分数。
样例输入
5
9 10
7 11
1 6
5 7
3 5
2
7 3
7 6
0
样例输出
19
13

 
#include <iostream>
using namespace std; 
int main()
{
int n,i,a,b,max;
while(cin>>n,n!=0)
{
max=0;
for(i=0;i<n;i++)
{
cin>>a>>b;
if(max<a+b)
{
max=a+b;
} 
} 
cout<<max<<endl;
} 
return 0; 
}        

 

谁是最好的Coder

标签:style   blog   io   color   os   for   sp   strong   数据   

原文地址:http://www.cnblogs.com/imwtr/p/4069605.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!