Page 1 of 1

11356 - Dates

Posted: Sun Nov 25, 2007 4:25 pm
by S.M.ferdous
I think its an easy problem but I m getting wrong answer!
Here is my code:

Code: Select all

    code removed after ac .
Many many thanks to hamedv...... :D


S.M.Ferdous

Posted: Sun Nov 25, 2007 6:11 pm
by hamedv
change this part

Code: Select all

...
            if(is_leapyear(year))  daymonth[2]=29;
            else daymonth[2]=28;
         }
      }

      printf("Case %d: %d-%s-%.2d\n",i,year,month[j],d);
   }
to

Code: Select all

...
            if(is_leapyear(year))  daymonth[2]=29;
            else daymonth[2]=28;
         }
      }

      printf("Case %d: %d-%s-%.2d\n",i,year,month[j],d);
      daymonth[2]=28;
   }

Posted: Mon Jan 14, 2008 5:06 pm
by RC's
Can anyone give tricky test cases ?

Re: 11356 - Dates

Posted: Tue Apr 22, 2014 12:46 pm
by uDebug
I found the following input / output useful during testing / debugging.

Input:

Code: Select all

5
1900-December-26
10000
2601-January-12
4562
2012-February-29
9999
1914-March-19
37
2999-December-31
1
AC Output:

Code: Select all

Case 1: 1928-May-13
Case 2: 2613-July-10
Case 3: 2039-July-16
Case 4: 1914-April-25
Case 5: 3000-January-01