2011年3月4日金曜日

Aizu Online Judge 0195 What is the Most Popular Shop in Tokaichi?

■0195 What is the Most Popular Shop in Tokaichi?

やるだけ.

  1. import java.util.*;  
  2. import java.lang.*;  
  3. import java.math.*;  
  4. import java.io.*;  
  5.   
  6. import static java.lang.Math.*;  
  7. import static java.util.Arrays.*;  
  8.   
  9. public class Main{  
  10.   
  11.  Scanner sc=new Scanner(System.in);  
  12.   
  13.  int INF=1<<28;  
  14.  double EPS=1e-9;  
  15.   
  16.  void run(){  
  17.   for(;;){  
  18.    int n=5;  
  19.    int max=0;  
  20.    char c='A';  
  21.    for(int i=0; i<n; i++){  
  22.     int a=sc.nextInt()+sc.nextInt();  
  23.     if(a==0){  
  24.      return;  
  25.     }  
  26.     if(a>max){  
  27.      c=(char)('A'+i);  
  28.      max=a;  
  29.     }  
  30.    }  
  31.    println(c+" "+max);  
  32.   }  
  33.  }  
  34.   
  35.  void debug(Object... os){  
  36.   System.err.println(Arrays.deepToString(os));  
  37.  }  
  38.   
  39.  void print(String s){  
  40.   System.out.print(s);  
  41.  }  
  42.   
  43.  void println(String s){  
  44.   System.out.println(s);  
  45.  }  
  46.   
  47.  public static void main(String[] args){  
  48.   // System.setOut(new PrintStream(new BufferedOutputStream(System.out)));  
  49.   new Main().run();  
  50.  }  
  51. }  

0 件のコメント: