POJ 2080 Calendar
来源:互联网 发布:2017单片机就业方向 编辑:程序博客网 时间:2024/06/06 08:53
Calendar
Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6463 Accepted: 2430
Description
A calendar is a system for measuring time, from hours and minutes, to months and days, and finally to years and centuries. The terms of hour, day, month, year and century are all units of time measurements of a calender system.
According to the Gregorian calendar, which is the civil calendar in use today, years evenly divisible by 4 are leap years, with the exception of centurial years that are not evenly divisible by 400. Therefore, the years 1700, 1800, 1900 and 2100 are not leap years, but 1600, 2000, and 2400 are leap years.
Given the number of days that have elapsed since January 1, 2000 A.D, your mission is to find the date and the day of the week.
According to the Gregorian calendar, which is the civil calendar in use today, years evenly divisible by 4 are leap years, with the exception of centurial years that are not evenly divisible by 400. Therefore, the years 1700, 1800, 1900 and 2100 are not leap years, but 1600, 2000, and 2400 are leap years.
Given the number of days that have elapsed since January 1, 2000 A.D, your mission is to find the date and the day of the week.
Input
The input consists of lines each containing a positive integer, which is the number of days that have elapsed since January 1, 2000 A.D. The last line contains an integer −1, which should not be processed.
You may assume that the resulting date won’t be after the year 9999.
You may assume that the resulting date won’t be after the year 9999.
Output
For each test case, output one line containing the date and the day of the week in the format of "YYYY-MM-DD DayOfWeek", where "DayOfWeek" must be one of "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" and "Saturday".
Sample Input
1730174017501751-1
Sample Output
2004-09-26 Sunday2004-10-06 Wednesday2004-10-16 Saturday2004-10-17 Sunday
Source
Shanghai 2004 Preliminary
/*
一个日历程序,输入一个自然数n,然后给出距离2000.01.01 n天的日期以及星期
*/
- POJ 2080 Calendar
- POJ - 2080 Calendar
- POJ 2080 Calendar
- poj 2080 Calendar
- Calendar-poj-2080
- POJ 2080 Calendar
- POJ 2080:Calendar
- POJ 2080 Calendar G++
- poj 2080 Calendar
- POJ 2080 Calendar
- poj 2080 Calendar
- POJ 2080 Calendar 日期计算
- POJ 1008 Maya Calendar
- poj 1008 Maya Calendar
- poj 1082 Calendar Game
- POJ 1008 Maya Calendar
- POJ 1008 Maya Calendar
- 【POJ】1008 Maya Calendar
- 我的新年愿景
- [Perl]One-Liner
- 从windows xp读取linux ext4分区的文件
- [Perl]利用XML::DOM生成XML文档
- 几种在线可视化HTML编辑器的比较
- POJ 2080 Calendar
- Trac+subversion拥有强大的bug管理能力
- [转]悟透JavaScript
- error C2065: 'WM_SETMESSAGESTRING' : undeclared identifier
- 【转】高级PHP应用程序漏洞审核技术
- 代码之美阅读笔记之--种群计数
- error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用 msvcrtd.lib
- 网络知识 关于IPv6的寻址和路由方法介绍
- error C2018: unknown character '0xa1'