I'm a code golf novice, but I'm eager to give it a go.
My challenge is: Write the shortest program in C which takes in a date
D as input and outputs the date
D + 1 day
- program must compile only with
gcc progname.c -o prognameSo no compiler/makefile tricks (if there are any) - compiler warnings don't matter
- The input and output format must be
day/month/yearzero padding of single digit values does not matter:
1/3/1998is equal to
- It doesn't matter how you give the the program it's input date, it can be a program argument,
scanfwhatever. Output must be to
- February has 29 days when the year is divisible by 4
- No date validation necessary, i.e. assume the input is always a valid date.
- any integer year should be supported, i.e.
INT_MIN -> INT_MAX
Shortest code length wins, and there are extra points for extra bastardised C.
My solution uses
126 123* 121 characters
*because of an idea Gareth's code gave me