From df9811c3e9aac8d33735c82ed3e40aff91f87bb5 Mon Sep 17 00:00:00 2001 From: Artem Horbunov Date: Thu, 26 Mar 2020 22:58:22 +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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/du3/program.c b/du3/program.c index 762247b..e4d61e9 100644 --- a/du3/program.c +++ b/du3/program.c @@ -17,9 +17,11 @@ int main(){ puts("Neplatny datum"); return 0; } - if(month == 4 || month == 6 || month == 9 || month == 11 && day > 30){ + if(month == 4 || month == 6 || month == 9 || month == 11){ +if(day > 30){ puts("Neplatny datum"); return 0; +} } day += 7; @@ -31,9 +33,11 @@ int main(){ month++; day -= 29; } - else if(month == 4 && month == 6 && month == 9 && month == 11 && day > 30){ + else if(month == 4 || month == 6 || month == 9 || month == 11){ +if(day > 30){ month++; day -= 30; +} } else if(day > 31){ month++; @@ -56,4 +60,4 @@ int main(){ else{ printf("%d.%d.%d\n\n", day, month, year); } -} \ No newline at end of file +}