#5232: d985測資懷疑有問題


alextsui1991 (Alex)


以下是程式碼:

import java.util.*;
public class d984{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    while(sc.hasNext()){
      int p[] = new int[3];
      int tempa[] = new int[3];
      int a = sc.nextInt();
      int b = sc.nextInt();
      int c = sc.nextInt();
      p[0] = a;
      tempa[0] = a;
      p[1] = b;
      tempa[1] = b;
      p[2] = c;
      tempa[2] = c;
      Arrays.sort(tempa);
      if((tempa[0] + tempa[1]) > tempa[2]){
        for(int i = 0 ; i < p.length;i++){
          if(tempa[1] == p[i]){
            loc(i);
          }
        }
      }else{
        for(int i = 0 ; i < p.length;i++){
          if(tempa[2] == p[i]){
            loc(i);
          }
        }
      }
    } 
  }
  public static void loc(int l){
    if(l == 0){
      System.out.println("A");
    }else if(l == 1){
      System.out.println("B");
    }else{
      System.out.println("C");
    }
  }
}