From 4aaee3af93eb3d0c0627e97b3c021d0993affba5 Mon Sep 17 00:00:00 2001 From: Kapliuk Date: Thu, 21 Mar 2024 19:20:59 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D0=B8=20'c?= =?UTF-8?q?v5/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cv5/program.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cv5/program.c b/cv5/program.c index 41e8c27..95984b7 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -49,7 +49,6 @@ int main(){ int value = strtol(line,&end,10); char* zaciatok_mena = end + 1; if (value == 0){ - printf("Nepodarilo nacitat nic\n"); break; } int velkost_mena = strlen(zaciatok_mena) - 1; @@ -76,7 +75,10 @@ int main(){ counter--; qsort(databaza, size, sizeof(struct student), compare_names); qsort(databaza, size, sizeof(struct student), compare_votes); - if(databaza[0].votes != 0) + + if(databaza[0].votes == 0) + printf("Nepodarilo nacitat nic\n"); + else printf("Vysledky:\n"); for(int i = 0; i < size; i++) { if(databaza[i].votes != 0)