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){