From f8a0031ec93c1f2e1bcf40f8a6c97224e3ec3066 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 26 Mar 2020 10:51:13 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'du3/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du3/program.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/du3/program.c b/du3/program.c index d14ce94..4aa5baa 100644 --- a/du3/program.c +++ b/du3/program.c @@ -2,10 +2,7 @@ #include #include 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){