#include #include #define VELKOST_POLA 52 int main() { int pole[VELKOST_POLA]; memset(pole,0,VELKOST_POLA * sizeof(int)); int participant_count = 0; for (int i = 0; i < VELKOST_POLA; ++i) { int value = 0; int r = scanf("%d", &value); if(r > 0 && value > 0) { pole[i] = value; participant_count++; } else { if(participant_count == 0) { printf("Chyba: Málo platných hodnôt.\n"); } break; } } int best_result = pole[0]; for (int i = 0; i < participant_count; ++i) { printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, pole[i]); if(best_result < pole[i]) { best_result = pole[i]; } } for (int i = 0; i < participant_count; ++i) { if(pole[i] == best_result) { printf("Výherca je súťažiaci %d ktorý vypil %d pohárov.\n", i + 1, best_result); } } return 0; }