diff --git a/a1/program.c b/a1/program.c index a24d37e..566e251 100644 --- a/a1/program.c +++ b/a1/program.c @@ -16,6 +16,7 @@ int main() { char* zaciatok_cisla = znaky; int cislo = 0; int counter = 0; + int che = 0; while ((r = fgets(znaky, LINE_SIZE, stdin)) != NULL) { if (feof(stdin)) { break; @@ -43,7 +44,7 @@ int main() { } if(counter != 3){ printf("Neplatny datum.\n"); - break; + che = 1; } //printf("%d %d %d\n", dd, mm, yyyy); time_t t = time(NULL); @@ -68,12 +69,14 @@ int main() { if(buffer[3] == 48){ buffer[3] = '&'; } + if(che == 0){ for(int i = 0; i < 10; i++){ if(buffer[i] != '&'){ printf("%c", buffer[i]); } - } printf("\n\n"); } + } + } return 0; }