Q 1609: [Algorithm Improvement VIP]Black Friday
Time limit: 1Sec Memory Limit: 128MB
Title Description
Some Westerners are superstitious, and if the 13th of a month falls on a Friday, they feel that it is not auspicious, or in ancient times, “bad for everything”. Write a program to find out how many times in a given year the 13th falls on a Friday, to help your superstitious friend solve his problem. Note: (1) There are 365 days in a year, and 366 days in a leap year. A leap year is a year that is divisible by 4 and not by 100, or a year that is divisible by both 100 and 400; (2) January 1, 1998 is known to be a Thursday, and the year entered by the user must be greater than or equal to 1998.
Input
The input has only one line, i.e. a specific year (greater than or equal to 1998).
Output
The output has only one line, i.e. how many times in the year it occurred that it was both the 13th and a Friday.
Sample Input
|
|
Sample Output
|
|
C Code
|
|