Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. int checkParola(char lettera, char* parola, int errori, char* parolaSegreta){
  2. int i = 0;
  3.  
  4. while(parola[i] != 0){
  5. if(lettera == parola[i]){
  6. parolaSegreta[i] = parola;
  7. printf("%s", parolaSegreta);
  8. }
  9. else{
  10. errori++;
  11. }
  12.  
  13. i++;
  14. }
  15.  
  16. return errori;
  17. }
  18.  
  19. int main() {
  20. char lettera;
  21. char* parola = "CIAO";
  22. char* parolaSegreta;
  23. int errori = 10;
  24.  
  25. while(errori <= 10){
  26. stampaImpiccato(errori);
  27. stampaParola(parola);
  28. scanf(" %c", &lettera);
  29. checkParola(lettera, parola, errori, parolaSegreta);
  30. }
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement