Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.14 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main()
  5. {
  6.     char d[7], l[7], p[7];
  7.     while (scanf("%s %s %s", d, l, p))
  8.     {
  9.     int winner=0;
  10.     // Winner Dodo
  11.     if (l[2]==p[2] && p[2]!=d[2])
  12.     {
  13.           if ((d[2]=='p' && l[2]=='d') || (d[2]=='d' && l[2]=='s') || (d[2]=='s' && l[2]=='p'))
  14.           {
  15.         winner=1;
  16.           }
  17.     }
  18.     // Winner Leo
  19.         if (d[2]==p[2] && p[2]!=l[2])
  20.     {
  21.       if ((l[2]=='p' && d[2]=='d') || (l[2]=='d' && d[2]=='s') || (l[2]=='s' && d[2]=='p'))
  22.           {
  23.         winner=2;
  24.           }
  25.     }
  26.     // Winner Pepper
  27.         if (d[2]==l[2] && l[2]!=p[2])
  28.     {
  29.       if ((p[2]=='p' && l[2]=='d') || (p[2]=='d' && l[2]=='s') || (p[2]=='s' && l[2]=='p'))
  30.           {
  31.         winner=3;
  32.           }
  33.     }
  34.     switch (winner)
  35.     {
  36.       default:
  37.       printf("Putz vei, o Leo ta demorando muito pra jogar…\n");
  38.       break;
  39.       case 1:
  40.       printf("Os atributos dos monstros vao ser inteligencia, sabedoria…\n");
  41.       break;
  42.       case 2:
  43.       printf("Iron Maiden’s gonna get you, no matter how far!\n");
  44.       break;
  45.       case 3:
  46.       printf("Urano perdeu algo muito precioso…\n");
  47.       break;
  48.     }
  49.     }
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement