2024-02-28 09:20:14 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int results[50];
|
|
|
|
int count = 0;
|
|
|
|
int max_score = 0;
|
2024-02-28 09:56:29 +00:00
|
|
|
|
|
|
|
while (count < 50) {
|
|
|
|
if (scanf("%d", &results[count]) != 1) {
|
|
|
|
return 1;
|
|
|
|
}
|
2024-02-28 09:20:14 +00:00
|
|
|
if (results[count] < 1) {
|
2024-02-28 09:56:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (results[count] < 0) {
|
|
|
|
break;
|
2024-02-28 09:20:14 +00:00
|
|
|
}
|
|
|
|
if (results[count] > max_score) {
|
|
|
|
max_score = results[count];
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
for (int i = 0; i < count; i++) {
|
2024-02-28 09:29:30 +00:00
|
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i+1, results[i]);
|
2024-02-28 09:20:14 +00:00
|
|
|
}
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
|
if (results[i] == max_score) {
|
2024-02-28 09:33:45 +00:00
|
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i+1, results[i]);
|
2024-02-28 09:20:14 +00:00
|
|
|
}
|
|
|
|
}
|
2024-02-28 09:56:29 +00:00
|
|
|
|
2024-02-28 09:20:14 +00:00
|
|
|
return 0;
|
|
|
|
}
|