Изменить 'du3/program.c'

This commit is contained in:
Pavlo Tverdyi 2020-03-26 10:51:13 +00:00
parent 4663059ce5
commit f8a0031ec9

View File

@ -2,10 +2,7 @@
#include <stdlib.h>
#include <string.h>
int main()
{
{
char *str;
str = (char*) malloc(12);
scanf("%s",str);
@ -20,6 +17,9 @@ if(m%2!=0 && day>31){
}
if(m%2==0 && day>30){
if(m==2 &&(y%400==0 ||(y%100!=0 && y%4==0))){
day-=28;
}
else if(m==2){
day-=29;
}
else{
@ -29,6 +29,7 @@ if(m%2==0 && day>30){
}
if(m>12){
m-=12;
day--;
y++;
}
if(m>9){