Advertisement
rdsedmundo

par_impar.c

Jan 8th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     int i;
  5.  
  6.     for(i = 0;; i++) {
  7.         int jogos, j;
  8.         scanf("%d", &jogos);
  9.  
  10.         if(jogos == 0)
  11.             break;
  12.  
  13.         char Nome[2][32];
  14.         scanf("%s %s", Nome[0], Nome[1]);
  15.  
  16.         printf("Teste %d\n", i + 1);
  17.  
  18.         for(j = 0; j < jogos; j++) {
  19.             int a, b;
  20.             scanf("%d %d", &a, &b);
  21.  
  22.             printf("%s\n", ((a+b)%2 == 0) ? Nome[0] : Nome[1]);
  23.         }
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement