That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answer this question, write a program that will compute the frequency that the 13th of each month lands on Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday over a given period of N years. The time period to test will be from January 1, 1900 to December 31, 1900+N-1 for a given number of years, N. N is non-negative and will not exceed 400.
There are few facts you need to know before you can solve this problem:
Do not use any built-in date functions in your computer language.
Don't just precompute the answers, either, please.
For each input, there is an output correspond to it, each have the following format:
Seven space separated integers on one line. These integers represent the number of times the 13th falls on Saturday, Sunday, Monday, Tuesday, ..., Friday.
20
36 33 34 33 35 35 34
刷道存在感。。
題意 :問從1900年往後的n年裡,每個月的13號分布在星期1到7的情況。。這算哈希?反正暴力就可以了
#include#include #include #include #include #include #include #include #include #include #include