Fork me on GitHub

NYOJ题目596谁是最好的Coder

--------------------------------------------

AC代码:

 1 import java.util.Scanner;
 2 
 3 public class Main {
 4 
 5     public static void main(String[] args) {
 6         
 7         Scanner sc=new Scanner(System.in);
 8         
 9         while(true){
10             
11             int n=sc.nextInt();
12             if(n==0) return ;
13             int ans=sc.nextInt()+sc.nextInt();
14             
15             while(--n>0){
16                 int t=sc.nextInt()+sc.nextInt();
17                 ans=Math.max(t,ans);
18             }
19             
20             System.out.println(ans);
21         }
22         
23     }
24     
25 }

 题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=596

posted @ 2016-08-27 14:43  CC11001100  阅读(173)  评论(0编辑  收藏  举报