pvjc24/cv2/program.c
2024-02-28 13:27:31 +01:00

27 lines
528 B
C

#include<stdio.h>
#define FIELD_SIZE 52
int main(){
int field[FIELD_SIZE] = {0}; // Inicializujte poľo na 0
int count = 0;
int max_num = 0;
int input;
while (count < FIELD_SIZE) {
if (input < 0) {
printf("Ukoncenie zadavania.\n");
break;
}
field[count] = input;
count++;
}
printf("Vypisane hodnoty:\n");
for (int i = 0; i < count; i++) {
printf("Sutaziaci č. %d vypil %d pohárov.\n", i + 1, field[i]);
}
return 0;
}