Merge branch 'master' of git.kemt.fei.tuke.sk:mu590ku/pvjc24

This commit is contained in:
Michal Utľák 2024-03-03 21:08:04 +01:00
commit 3875360b19

View File

@ -27,20 +27,20 @@ int main() {
printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, pole[i]);
}
int maxPoharov = pole[0];
int pohare = pole[0];
int pocetVyhercov = 1;
for (int i = 1; i < pocetCisel; i++) {
if (pole[i] > maxPoharov) {
maxPoharov = pole[i];
if (pole[i] > pohare) {
pohare = pole[i];
pocetVyhercov = 1;
} else if (pole[i] == maxPoharov) {
} else if (pole[i] == pohare) {
pocetVyhercov++;
}
}
for (int i = 0; i < pocetCisel; i++) {
if (pole[i] == maxPoharov) {
if (pole[i] == pohare) {
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i + 1, pole[i]);
}
}