Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. /*
  2. * Matheus Oliveira
  3. * 30/03/2017
  4. * 1129.cpp
  5. */
  6.  
  7. #include <cstdio>
  8.  
  9. int main () {
  10.  
  11. int n, i, answer, j, count_black, alternative;
  12. char letters[5] = {'A', 'B', 'C', 'D', 'E'};
  13.  
  14. while (scanf("%d", &n) && n != 0) {
  15.  
  16. for(i=0; i < n; i++) {
  17.  
  18. count_black = 0;
  19.  
  20. for(j=0; j < 5; j++) {
  21.  
  22. scanf("%d", &alternative);
  23. if(alternative <= 127) count_black++, answer = j;
  24. }
  25.  
  26. if(count_black == 1) printf("%c\n", letters[answer]);
  27. else printf("*\n");
  28. }
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement