32 lines
760 B
C
32 lines
760 B
C
#include <stdio.h>
|
|
|
|
#define MAX_SUTAZIACI 10
|
|
|
|
int main() {
|
|
int pocetPoharov[MAX_SUTAZIACI] = {0};
|
|
int maxPoharov = 0;
|
|
int cisloSutaziaceho = 0;
|
|
int vypitiePoharov;
|
|
|
|
|
|
printf("Zadajte počet vypitých pohárov pre každého súťažiaceho:\n");
|
|
while (scanf("%d", &vypitiePoharov) == 1) {
|
|
pocetPoharov[cisloSutaziaceho] = vypitiePoharov;
|
|
if (vypitiePoharov > maxPoharov) {
|
|
maxPoharov = vypitiePoharov;
|
|
}
|
|
cisloSutaziaceho++;
|
|
}
|
|
|
|
|
|
printf("Súťažiaci s maximálnym počtom pohárov (%d):\n", maxPoharov);
|
|
for (int i = 0; i < cisloSutaziaceho; i++) {
|
|
if (pocetPoharov[i] == maxPoharov) {
|
|
printf("%d ", i);
|
|
}
|
|
}
|
|
printf("\n");
|
|
|
|
return 0;
|
|
}
|