Advertisement
PROFESSOR_AIH

Grenais

Apr 7th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int a=0,b=0,inter=0,gremio=0,total=0,drow=0,x;
  5.     while(1)
  6.     {
  7.         scanf("%d %d",&a,&b);
  8.         printf("Novo grenal (1-sim 2-nao)\n");
  9.         total++;
  10.         if(a>b)
  11.             inter++;
  12.         else if(a<b)
  13.             gremio++;
  14.         else if(a==b)
  15.             drow++;
  16.         a=0;
  17.         b=0;
  18.         scanf("%d",&x);
  19.         if(x==1)
  20.             continue;
  21.         else if(x==2)
  22.             break;
  23.     }
  24.     printf("%d grenais\nInter:%d\nGremio:%d\nEmpates:%d\n",total,inter,gremio,drow);
  25.     if(inter>gremio)
  26.         printf("Inter venceu mais\n");
  27.     else if(gremio>inter)
  28.         printf("Gremio venceu mais\n");
  29.     else
  30.         printf("Não houve vencedor\n");
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement