Advertisement
Guest User

1129

a guest
Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int n;
  7.         int[] a = new int[5];
  8.         while (true) {
  9.             n = scan.nextInt();
  10.             if (n == 0) {
  11.                 break;
  12.             }
  13.             for (int i = 0; i < n; i++) {
  14.                 int ss = -1;
  15.                 for (int j = 0; j < 5; j++) {
  16.                     a[j] = scan.nextInt();
  17.                     if (a[j] <= 127) {
  18.                         if (ss == -1) {
  19.                             ss = j;
  20.                         } else {
  21.                             ss = 123;
  22.                         }
  23.                     }
  24.                 }
  25.                 if (ss > -1 && ss < 5) {
  26.                     System.out.println((char) (ss + 65));
  27.                 } else {
  28.                     System.out.println('*');
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement