From c28dff4800376cd5790d305cf948bfc13abe3552 Mon Sep 17 00:00:00 2001 From: Matus Tokarcik Date: Thu, 21 Mar 2024 19:13:33 +0100 Subject: [PATCH] cv5 --- cv5/program.c | 10 +++++++++- cv5/program.exe | Bin 68643 -> 68836 bytes 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cv5/program.c b/cv5/program.c index 09e4514..7685db4 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -17,7 +17,7 @@ int find_student(struct student* students,int size, const char* name){ return i; //ak najde studenta } } - printf("nenaslo studenta\n"); // ak nenajde studenta + //printf("nenaslo studenta\n"); // ak nenajde studenta return -1; } @@ -41,12 +41,14 @@ int main(){ memset(line,0,SIZE); char* r = fgets(line,SIZE,stdin); if (r == NULL){ + return -1; } //nacitanie celeho cisla, premiena kym nepride na znak ktory nieje cislo char* end = NULL; int value = strtol(line,&end,10); if (value == 0){ + return 1; } // pomocné pole char name[SIZE]; @@ -66,6 +68,7 @@ int main(){ } else { printf( "nepodarilo sa nacitat meno \n"); +return 1; } //prejde vsetky polozky v databaze @@ -79,11 +82,16 @@ if (id< 0){ } else{ printf("databaza je plna\n"); + return 1; } } else { databaza[id].votes = value; } + printf("Vysledky:\n"); + for (int i = 0; i < size; i++){ + printf ("%d %s\n", databaza[i].votes, databaza[i].name); + } return 0; } \ No newline at end of file diff --git a/cv5/program.exe b/cv5/program.exe index 532b0ec9f27ae414b15cc3279e87db65320289ad..cd048ef3920688862e266ed500f8b1fe7a63d21f 100644 GIT binary patch delta 5058 zcmbtXeOQ!L7Qgq-49tv<3QbLV{p2LIaaeV#kN^ZVU% z&pr3v^WK?x`xW^Qugaa9RCk{1<$%xl&!7!lK@+Zk|FjKu;f4kWxb2)luQ_$16$} zHpsP^-bZPMYbRSOd)!C~@elVQirco(>#7B@x|4mkOKGTA8e!>uC5e6aB1?1D;Mk z)KPB1FxIkl4s`Q&0WgN8u;g!g%bie#m= z%uO+pnMbM+0plOT-ZBq$l#liW;Gbl@4GhZg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