33 lines
722 B
C
33 lines
722 B
C
#include <stdio.h>
|
|
#include <stdbool.h>
|
|
|
|
int main() {
|
|
int results[50], count = 0, num, maxPoharov = 0;
|
|
|
|
while (count < 50 && scanf("%d", &num) == 1) {
|
|
if (num < 1) {
|
|
|
|
continue;
|
|
}
|
|
results[count++] = num;
|
|
}
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, results[i]);
|
|
if (results[i] > maxPoharov) {
|
|
maxPoharov = results[i];
|
|
}
|
|
}
|
|
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
if (results[i] == maxPoharov) {
|
|
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i + 1, maxPoharov);
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|