skuska
This commit is contained in:
parent
2da85cf65c
commit
c9ede47f41
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user