Advertisement
Guest User

Prova 2018.1

a guest
Mar 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.  
  5. int candidato,N=0,candidato1,candidato2,candidato3;
  6. char resp;
  7. do{
  8. printf("ELEIÇÃO PARA CAPITÃO\n");
  9.  
  10. do{
  11. printf("ESCOLHA SEU CANDIDATO: GURI=1, PI=2,MIGUEL=3\n");
  12. scanf("%d",&candidato);
  13. if (candidato != 1 && candidato !=2 && candidato!=3 ) {printf("Numero invalido\n");}
  14.   }
  15.  
  16. while (candidato != 1 && candidato !=2 && candidato!=3);
  17. if (candidato==1){ candidato1++;}
  18. if (candidato==2){ candidato2++;}
  19. if (candidato==3){ candidato3++;}
  20. N++;
  21. printf("deseja continuar a pesquisa?S/N\n");
  22. scanf("%c",&resp);
  23. }while(resp=='S');
  24.  
  25.  
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement