diff --git a/cv5/program.c b/cv5/program.c index d9449e9..bb45246 100644 --- a/cv5/program.c +++ b/cv5/program.c @@ -20,23 +20,34 @@ char line[SIZE]; int main() { memset(databaza, 0, SIZE * sizeof(struct student)); - int prvy_vstup = 1; + int prvyInput = 1; while (1) { memset(line, 0, SIZE); char *r = fgets(line, SIZE, stdin); if (r == NULL) { - break; + if(prvyInput){ + printf("Nepodarilo nacitat nic\n"); + return 0; + } + else{ + break; + } } if (strcmp(line, "\n") == 0) { - continue; + if (prvyInput) { + printf("Nepodarilo nacitat nic\n"); + return 0; + } else { + continue; + } } int value = strtol(line, NULL, 10); if (value == 0) { - if (prvy_vstup) { + if (prvyInput) { printf("Nepodarilo nacitat nic\n"); return 0; } else { @@ -44,7 +55,7 @@ int main() { } } - prvy_vstup = 0; + prvyInput = 0; char name[SIZE]; memset(name, 0, SIZE);