diff --git a/du3/program.c b/du3/program.c index c274ab5..af0090a 100644 --- a/du3/program.c +++ b/du3/program.c @@ -5,7 +5,7 @@ int main(){ int month; int year; scanf("%d.%d.%d", &day, &month, &year); - if(day < 1 || day > 31 || month < 1 || month > 12){ + if(day < 1 || day > 31 || month < 1 || month > 12 || year < 0){ puts("Nespravny datum"); return 0; } @@ -60,4 +60,4 @@ if(day > 30){ else{ printf("%d.%d.%d\n\n", day, month, year); } -} +} \ No newline at end of file