29 lines
746 B
C
29 lines
746 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
int results[50];
|
|
int count = 0;
|
|
int max_score = 0;
|
|
while (scanf("%d", &results[count]) == 1) {
|
|
if (results[count] < 1) {
|
|
break;
|
|
}
|
|
if (results[count] > max_score) {
|
|
max_score = results[count];
|
|
}
|
|
count++;
|
|
}
|
|
if (count == 0) {
|
|
printf("Chyba: Málo platných hodnôt.\n");
|
|
return 0;
|
|
}
|
|
for (int i = 0; i < count; i++) {
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i+1, results[i]);
|
|
}
|
|
for (int i = 0; i < count; i++) {
|
|
if (results[i] == max_score) {
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i+1, results[i]);
|
|
}
|
|
}
|
|
return 0;
|
|
} |