From 652d03d9d40852382b55cb2c3012f7167dfa0a3b Mon Sep 17 00:00:00 2001 From: Artem Horbunov Date: Thu, 26 Mar 2020 23:06:58 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu3/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du3/program.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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