Advertisement
Guest User

Untitled

a guest
Feb 27th, 2011
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.64 KB | None | 0 0
  1. #include<stdlib.h>
  2. #include<stdio.h>
  3.  
  4. int main(void)
  5. {
  6.  
  7.     int idade, menor_idade, maior_idade, dif_idade, por_pessimo, acc_o,acc_r;  
  8.     int i;
  9.     int c;
  10.     int op;
  11.     float media_ruim;
  12.     float me_i_ruim;
  13.     float dif_por_b_re;
  14.    
  15.     acc_o = 0;
  16.     acc_r = 0;
  17.     int acc_b = 0;
  18.     int acc_re = 0;
  19.     int acc_p = 0;
  20.     int acc_i_r = 0;
  21.    
  22.       for (c=1;c<=3;c++)
  23.       {
  24.  
  25.          printf ("Informe a idade:");
  26.          scanf ("%d",&idade);
  27.          printf("Escolha uma opcao: 1 - Otimo, 2 - Bom, 3 -Regular, 4 - Ruim ou 5 - Pessimo");
  28.          scanf("%d",&op);      
  29.  
  30.          if (idade > maior_idade)
  31.          maior_idade = idade;
  32.           if (idade < menor_idade)
  33.           menor_idade = idade;
  34.          
  35.                 menor_idade = idade;
  36.                 maior_idade = idade;
  37.  
  38.                 if (op==4)
  39.                 acc_i_r++;
  40.            
  41.  
  42.                switch (op) {
  43.                case 1: acc_o++;break;
  44.                case 2: acc_b++; break;
  45.                case 3: acc_re++; break;
  46.                case 4: acc_r++; break;
  47.                case 5: acc_p++; break;
  48.                }
  49.        
  50.       }
  51.  
  52.       //media_ruim = acc_r / acc_id_r;
  53.       dif_por_b_re = (acc_b - acc_re) / 100;
  54.       por_pessimo = (acc_p / 100);
  55.      
  56. printf("A quantidade de respostas otimo eh %d\n",acc_o);
  57. printf("A diferenca percentual entre respostas bom e regular eh: %f\n",dif_por_b_re);
  58. //printf("A media das pessoas que responderam ruim eh %f\n",media_ruim);
  59. //printf("A porcentagem de respostas pessimo eh %f a maior idade que utilizou esta opcao eh: %d\n",por_pessimo,maior);
  60.  
  61.  
  62. getch();
  63. return 0;
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement