test
This commit is contained in:
parent
48db813220
commit
5c79dff800
@ -0,0 +1,27 @@
|
||||
#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) {
|
||||
return 1;
|
||||
}
|
||||
if (results[count] > max_score) {
|
||||
max_score = results[count];
|
||||
}
|
||||
count++;
|
||||
}
|
||||
printf("\nVýsledky:\n");
|
||||
for (int i = 0; i < count; i++) {
|
||||
printf("Súťažiaci č. %d vypil %d pohárov.\n", i+1, results[i]);
|
||||
}
|
||||
printf("\nVýherci:\n");
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (results[i] == max_score) {
|
||||
printf("Súťažiaci č. %d ktorý vypil %d pohárov.\n", i+1, results[i]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user