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 +}