Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<stdio.h>
  2. int main() {
  3. int n, i, nivo, brpobedi, brporazi, poeni = 0, maxpoeni = 0, maxIndeks = 0;
  4. scanf("%d", &n);
  5. for (i = 0; i < n; i++) {
  6. scanf("%d %d %d", &nivo, &brpobedi, &brporazi);
  7. if (nivo == 1)
  8. {
  9. poeni = brpobedi * 13 + brporazi * (-1);
  10. }
  11. else if (nivo == 2)
  12. {
  13. poeni = brpobedi * 13 + brporazi * (-3);
  14. }
  15. if (poeni > maxpoeni)
  16. {
  17. maxpoeni = poeni;
  18. maxIndeks = i+1;
  19. }
  20.  
  21. if (poeni > 0)
  22. {
  23. printf("Dobar igrac\n");
  24. }
  25. else printf("Los igrac\n");
  26.  
  27.  
  28.  
  29. }
  30.  
  31. printf("Najdobar igrac: br %d, %d poeni", maxIndeks, maxpoeni);
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement