From 6e52173049befb9c1d17f15107bd32ea7c3a988b Mon Sep 17 00:00:00 2001 From: ak643du Date: Wed, 28 Feb 2024 14:36:14 +0100 Subject: [PATCH] Cv2 commit --- cv2/program.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cv2/program.c b/cv2/program.c index 9ea81de..6507963 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -13,12 +13,15 @@ int main(){ break; } if (input < 0) { - printf("Chyba: Málo platných hodnôt.\n"); break; } field[count] = input; count++; } + if (count < 2) { + printf("Chyba: Málo platných hodnôt.\n"); + return 0; + } for (int i = 0; i < count; i++) { printf("Súťažiaci č. %d vypil %d pohárov.\n", i + 1, field[i]);