From 3ea86f6735e6e07b842445daab667560b47e1a89 Mon Sep 17 00:00:00 2001 From: ak643du Date: Thu, 21 Mar 2024 17:45:35 +0100 Subject: [PATCH] Initialization --- cv5/program.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cv5/program.c b/cv5/program.c index 5433464..b5370e1 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -38,7 +38,12 @@ int main() { // check if the line is empty if (r == NULL || (r[0] == '\n' && strlen(r) == 1)) { // end of input - break; + if (successful_lines == 0) { + printf("Nepodarilo nacitat nic\n"); + return 0; + } else { + break; + } } // parse the string and extract number of votes and student name