11356 - Dates

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
S.M.ferdous
New poster
Posts: 13
Joined: Fri Nov 03, 2006 2:53 pm
Location: bangladesh
Contact:

11356 - Dates

Post 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
Last edited by S.M.ferdous on Sun Nov 25, 2007 6:27 pm, edited 1 time in total.
hamedv
Learning poster
Posts: 98
Joined: Mon May 07, 2007 8:30 am

Post 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;
   }
RC's
Learning poster
Posts: 65
Joined: Fri Jul 13, 2007 3:17 pm

Post by RC's »

Can anyone give tricky test cases ?
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 11356 - Dates

Post 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
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
Post Reply

Return to “Volume 113 (11300-11399)”