-->
当前位置:首页 > 题库

PROGRAMMING:calendar

Luz5年前 (2021-05-10)题库431
A calendar is a system for expressing time, from hour to minute, from month to day, and finally from year to century. The terms hour, day, month, year and century are all units of time in the calendar system.
According to the solar calendar currently used in China, leap year is defined as the year that can be divided by 4, but the year that can be divided by 100 but not by 400 is an exception. They are not leap years. For example, 1700, 1800, 1900 and 2100 are not leap years, while 1600, 2000 and 2400 are leap years. Given the number of days after January 1, 2000, your task is to give the year, month, day and week of the day.
###Input format:
The input contains several lines, each of which contains a positive integer to represent the number of days after January 1, 2000. Input the last line is - 1, the program does not have to deal with. It can be assumed that the output year will not exceed 9999.
###Output format:
For each test sample, output a line containing the corresponding date and day of the week. The format is "yyyy-mm-dd DayOfWeek", where "DayOfWeek" must be one of the following constants: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" or "Saturday".
###Input example:
```in
one thousand six hundred and twenty-nine
one thousand three hundred and forty-five
one thousand and one
one thousand eight hundred and seventy-six
-1
```
###Output example:
```out
2004-06-17 Thursday
2003-09-07 Sunday
2002-09-28 Saturday
2005-02-19 Saturday
```







answer:If there is no answer, please comment