This commit is contained in:
Weber 2024-02-28 09:56:29 +00:00
parent 2da85cf65c
commit c9ede47f41

View File

@ -4,9 +4,16 @@ int main() {
int results[50];
int count = 0;
int max_score = 0;
while (scanf("%d", &results[count]) == 1) {
while (count < 50) {
if (scanf("%d", &results[count]) != 1) {
return 1;
}
if (results[count] < 1) {
return 0;
break;
}
if (results[count] < 0) {
break;
}
if (results[count] > max_score) {
max_score = results[count];
@ -21,5 +28,6 @@ int main() {
printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i+1, results[i]);
}
}
return 0;
}