Advertisement
gtw7375

Questao 8 - Portugal

Sep 10th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. main() {
  2.    
  3.     int opcao, vt1=0, vt2=0, vt3=0, vt4=0, vt5=0;
  4.     int a=1;   
  5.     //  printf("ELEICOES 2014 \n \n");
  6.         printf("Escolha seu candidato: \n 1-JOSE \n 2-MARIA \n 3-JOAO \n 4-BRANCO \n 5-NULO \n");
  7.         scanf("%d", &opcao);
  8.    
  9.     while(a) {
  10.        
  11.    
  12.         switch(opcao) {
  13.            
  14.             case 1:
  15.                
  16.                
  17.                 vt1 +=1;
  18.                
  19.                 break;
  20.            
  21.             case 2:
  22.                
  23.                 vt2+=1;
  24.                 break;
  25.            
  26.             case 3:
  27.                
  28.                 vt3+=1;
  29.                 break;
  30.                
  31.             case 4:
  32.            
  33.                 vt4+=1;
  34.                 break;
  35.                
  36.             case 5:
  37.                
  38.                 vt5+=1;
  39.                 break;
  40.            
  41.        
  42.             }
  43.         }
  44.        
  45.     system("pause");
  46.  
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement