Update 'cv2/program.c'
This commit is contained in:
parent
b58f391316
commit
a11eba70f8
@ -1,5 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int main() {
|
||||
int results[50], count = 0, num, maxPoharov = 0;
|
||||
@ -10,21 +9,19 @@ int main() {
|
||||
continue;
|
||||
}
|
||||
results[count++] = num;
|
||||
if (num > maxPoharov) {
|
||||
maxPoharov = 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user