Problem 602
-- What day is it?
read problem
Tips
A calendar problem that many programmers
hate to deal with. Don't touch it if you have no experience in
writting any calendar program before.
My approach:
- Get Year, Month and Day from input
lines. If it is an invalid date, report it.
- Determine whether it is in Modern
Calendar or Old Calendar.
- Determine whether it is a leap year.
Note that the leap year rules for Modern and Old Calendar
are different.
- Find out the weekday by counting how
many days has passed since 01 Jan Year 1. If it is in Old
Calendar, do some adjustment to the weekday.