Advertisement
NoxScourge

Untitled

Sep 13th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. void main() {
  4. char ime[20], prez[20], maxime[20], maxprez[20], pol;
  5. int muski, i;
  6. int rez, maxrez;
  7. int zena = 0;
  8. maxrez = 100;
  9. i = 0;
  10. while (i <= 2) {
  11. printf("\n");
  12. printf("Unesite ime i prezime osobe:");
  13. scanf("%s%s", ime, prez);
  14.  
  15. printf("Unesite koliko ta osoba voli Davida :");
  16. scanf("%d", &rez);
  17.  
  18. printf("Unesite pol osobe:");
  19.  
  20. scanf("%c", &pol);
  21. pol = getchar();
  22.  
  23.  
  24. if (pol == 'Z' && rez>100)
  25. {
  26.  
  27. zena++;
  28. printf("\n");
  29. printf("%s %s %d %%\n", ime, prez, rez);
  30. if (rez>maxrez) {
  31. strcpy(maxime, ime);
  32. strcpy(maxprez, prez);
  33. maxrez = rez;
  34. }
  35. }
  36. i++;
  37. }
  38. printf("Pobednik je: %s %s %d %% \n", maxime, maxprez, maxrez);
  39. printf("Koliko ga devojaka voli van proseka= %d\n", zena);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement