Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- int n, i, nivo, brpobedi, brporazi, poeni = 0, maxpoeni = 0, maxIndeks = 0;
- scanf("%d", &n);
- for (i = 0; i < n; i++) {
- scanf("%d %d %d", &nivo, &brpobedi, &brporazi);
- if (nivo == 1)
- {
- poeni = brpobedi * 13 + brporazi * (-1);
- }
- else if (nivo == 2)
- {
- poeni = brpobedi * 13 + brporazi * (-3);
- }
- if (poeni > maxpoeni)
- {
- maxpoeni = poeni;
- maxIndeks = i+1;
- }
- if (poeni > 0)
- {
- printf("Dobar igrac\n");
- }
- else printf("Los igrac\n");
- }
- printf("Najdobar igrac: br %d, %d poeni", maxIndeks, maxpoeni);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement