What is the shortest program that can predict the next time Friday will fall on the 13th day of the month?
- Must be an complete functioning program (not just a function/subroutine)
- Must print out date in the following format:
YYYY-MM-DD
- Allow user to provide a start date either as a command line argument or through
STDIN
- If user provides no start date, use today as the start date.
- If the start date is a Friday the 13th, the program should find the next Friday the 13th.
If I were to run the program today (Feb 16 2011) I should get the following output.
$ ./fr13th 2013-05-09
2013-09-13
$ ./fr13th 2007-06-29
2007-07-13
$ ./fr13th 2007-07-13
2008-06-13
$ ./fr13th
2011-05-13
2013-9-13
output be ok for the first example? \$\endgroup\$