From dc26880ed5b12f056ef8dee0ef1f5fe485f68007 Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Thu, 23 Mar 2023 17:55:27 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'a1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a1/program.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/a1/program.c b/a1/program.c index c140918..6d717b9 100644 --- a/a1/program.c +++ b/a1/program.c @@ -33,16 +33,25 @@ int main() { } else { if (counter == 0) { dd = cislo; + if(dd == 0){ + che = 1; + } } else if (counter == 1) { - mm = cislo; + mm = cislo; + if(mm == 0){ + che = 1; + } } else if (counter == 2) { yyyy = cislo; + if(yyyy == 0){ + che = 1; + } } counter++; zaciatok_cisla = koniec_cisla + 1; } } - if(counter != 3){ + if(counter != 3 || che == 1){ printf("Neplatny datum.\n"); che = 1; }