--------------------------------------------
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
时间: 2024-11-05 13:46:25