1546_DoubleTime

2022-5-16 18:17| 发布者: Hocassian| 查看: 29| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-2-89503909195200-Problem List-采集的数据-后羿采集器.html

Pro.ID

1546

Title

Double Time

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=1546

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    In 45 BC a standard calendar was adopted by Julius Caesar -- each year would have 365 days, and every fourth year have an extra day -- the 29th of February. However this calendar was not quite accurate enough to track the true solar year, and it became noticeable that the onset of the seasons was shifting steadily through the year. In 1582 Pope Gregory XIII ruled that a new style calendar should take effect. From then on, century years would only be leap years if they were divisible by 400. Furthermore the current year needed an adjustment to realign the calendar with the seasons. This new calendar, and the correction required, were adopted immediately by Roman Catholic countries, where the day following Thursday 4 October 1582 was Friday 15 October 1582. The British and Americans (among others) did not follow suit until 1752, when Wednesday 2 September was followed by Thursday 14 September. (Russia did not change until 1918, and Greece waited until 1923.) Thus there was a long period of time when history was recorded in two different styles.

    Write a program that will read in a date, determine which style it is in, and then convert it to the other style.

    输入

    Input will consist of a series of lines, each line containing a day and date (such as Friday 25 December 1992). Dates will be in the range 1 January 1600 to 31 December 2099, although converted dates may lie outside this range. Note that all names of days and months will be in the style shown, that is the rst letter will be capitalised with the rest lower case. The le will be terminated by a line containing a single '#'.

    输出

    Description

    In 45 BC a standard calendar was adopted by Julius Caesar -- each year would have 365 days, and every fourth year have an extra day -- the 29th of February. However this calendar was not quite accurate enough to track the true solar year, and it became noticeable that the onset of the seasons was shifting steadily through the year. In 1582 Pope Gregory XIII ruled that a new style calendar should take effect. From then on, century years would only be leap years if they were divisible by 400. Furthermore the current year needed an adjustment to realign the calendar with the seasons. This new calendar, and the correction required, were adopted immediately by Roman Catholic countries, where the day following Thursday 4 October 1582 was Friday 15 October 1582. The British and Americans (among others) did not follow suit until 1752, when Wednesday 2 September was followed by Thursday 14 September. (Russia did not change until 1918, and Greece waited until 1923.) Thus there was a long period of time when history was recorded in two different styles.

    Write a program that will read in a date, determine which style it is in, and then convert it to the other style.

    Input

    Input will consist of a series of lines, each line containing a day and date (such as Friday 25 December 1992). Dates will be in the range 1 January 1600 to 31 December 2099, although converted dates may lie outside this range. Note that all names of days and months will be in the style shown, that is the rst letter will be capitalised with the rest lower case. The le will be terminated by a line containing a single '#'.

    Output

    Output will consist of a series of lines, one for each line of the input. Each line will consist of a date in the other style. Use the format and spacing shown in the example and described above. Note that there must be exactly one space between each pair of elds. To distinguish between the styles, dates in the old style must have an asterisk ('*') immediately after the day of the month (with no intervening space). Note that this will not apply to the input.

    Sample Input

    Saturday 29 August 1992
    Saturday 16 August 1992
    Wednesday 19 December 1991
    Monday 1 January 1900
    #

    Sample Output

    Saturday 16* August 1992
    Saturday 29 August 1992
    Wednesday 1 January 1992
    Monday 20* December 1899

    Source

    样例输入

    Saturday 29 August 1992
    Saturday 16 August 1992
    Wednesday 19 December 1991
    Monday 1 January 1900
    #

    样例输出

    Saturday 16* August 1992
    Saturday 29 August 1992
    Wednesday 1 January 1992
    Monday 20* December 1899

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部