Advertisement
Guest User

Penaltis.TheHuxley

a guest
Aug 23rd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.48 KB | None | 0 0
  1.  
  2.     #include <stdio.h>
  3. int main ()
  4. {
  5.     int CobrancaTime_1, CobrancaTime_2, GolTime_1, GolTime_2, ErroTime_1, ErroTime_2, ContGol_1, ContGol_2, ContErro_1, ContErro_2, soma1, soma2, Cont_1, Cont_2, a, b, c, d;
  6.     int n1, n2;
  7.     GolTime_1 = 0;
  8.     GolTime_2 = 0;
  9.     ErroTime_1 = 0;
  10.     ErroTime_2 = 0;
  11.     ContGol_1 = 0;
  12.     ContGol_2 = 0;
  13.     ContErro_1 = 0;
  14.     ContErro_2 = 0;
  15.     soma1 = 0;
  16.     soma2 = 0;
  17.     Cont_1 = 0;
  18.     Cont_2 = 0;
  19.     c = 1;
  20.     for(a = 1; a <= 10; a++)
  21.     {
  22.         if((ContGol_1 + 3 != ContGol_2)&&(ContGol_2 + 3 != ContGol_1))
  23.         {
  24.        
  25.         if(a % 2 != 0)
  26.         {
  27.            
  28.             scanf("%d", &CobrancaTime_1);
  29.             if(CobrancaTime_1 == 1)
  30.             {
  31.                 ContGol_1++;
  32.             }else
  33.             {
  34.                 ErroTime_1++;
  35.             }
  36.        
  37.         }else if(a % 2 == 0)
  38.         {
  39.        
  40.             scanf("%d", &CobrancaTime_2);
  41.             if(CobrancaTime_2 == 1)
  42.             {
  43.                 ContGol_2++;
  44.             }else
  45.             {
  46.                 ErroTime_2++;
  47.             }
  48.            
  49.         }
  50.        }
  51.     }
  52.     soma1 = GolTime_1 - ErroTime_1;
  53.     soma2 = GolTime_2 - ErroTime_2;
  54.    
  55.     if(soma1 > soma2)
  56.     {
  57.         printf("COMPUTACAO.RAR");
  58.     }else if(soma2>soma1)
  59.     {
  60.         printf("EDUCACAO FISICA");
  61.     }else if(soma1 == soma2)
  62.     {
  63.        
  64.         while(c != 0)
  65.         {
  66.             d++;
  67.             if(d % 2 != 0)
  68.             {
  69.                
  70.                 scanf("%d", &c);
  71.                 if(c == 1)
  72.                 {
  73.                     Cont_1++;
  74.                 }else
  75.                 {
  76.                     n1 = 0;
  77.                 }
  78.             }else if(d % 2 == 0)
  79.             {
  80.                
  81.                 scanf("%d", &c);
  82.                 if(c == 1)
  83.                 {
  84.                     Cont_2++;
  85.                 }else
  86.                 {
  87.                     n2 = 0;
  88.                 }
  89.             }
  90.         }
  91.         if(Cont_1>Cont_2)
  92.         {
  93.             printf("COMPUTACAO.RAR");
  94.         }else
  95.         {
  96.             printf("EDUCACAO FISICA");
  97.         }
  98.     }
  99.    
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement