fork download
  1. import java.util.Arrays;
  2. import java.util.Scanner;
  3.  
  4. class Ideone {
  5. public static void main(String[] args) {
  6. Scanner sc = new Scanner(System.in);
  7. int num = Integer.parseInt(sc.nextLine().split(" ")[0]);
  8. String[] output = new String[num];
  9. for (int index = 0; index < num; ++index) {
  10. String arr[] = sc.nextLine().split(" ");
  11.  
  12. System.out.println("arr[0]: " + Integer.parseInt(arr[0]));
  13. System.out.println("arr[1]: " + Integer.parseInt(arr[1]));
  14. System.out.println("arr[2]: " + Integer.parseInt(arr[2]));
  15. if ((Integer.parseInt(arr[0]) + Integer.parseInt(arr[1]) + Integer.parseInt(arr[2])) == 180) {
  16. output[index] = "YES";
  17. } else {
  18. output[index] = "NO";
  19. }
  20. }
  21. System.out.println(Arrays.toString(output));
  22. }
  23. }
Success #stdin #stdout 0.16s 51928KB
stdin
3
40 40 100
45 45 90
180 1 1
stdout
arr[0]: 40
arr[1]: 40
arr[2]: 100
arr[0]: 45
arr[1]: 45
arr[2]: 90
arr[0]: 180
arr[1]: 1
arr[2]: 1
[YES, YES, NO]