Aktualizovat „du3/program.c“

This commit is contained in:
Artem Horbunov 2020-03-26 22:58:22 +00:00
parent 28561962b3
commit df9811c3e9

View File

@ -17,9 +17,11 @@ int main(){
puts("Neplatny datum"); puts("Neplatny datum");
return 0; 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"); puts("Neplatny datum");
return 0; return 0;
}
} }
day += 7; day += 7;
@ -31,9 +33,11 @@ int main(){
month++; month++;
day -= 29; 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++; month++;
day -= 30; day -= 30;
}
} }
else if(day > 31){ else if(day > 31){
month++; month++;