题目说明
找出某一年中,大于给定天数的月份数;
输入描述:
第一行:输入N,表示测试样例个数。【N<100000】
第二行:样例1数据-》year 和 date
……………… ………………………………………………………
第N行 : 样例N数据-》year 和 date
输出描述:
第一行:输出样例1数量
第二行:输出样例2数量
……………… ………………………………
第N行 :输出样例N数量
实例1
输入:
1
2017 30
输出:
7
实例2
输入:
2
2018 30
2019 4
输出:
7
12
代码演示
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
class Solution
{
public:
bool judgeYear(int year)
{
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
{
return true;
}
return false;
}
int getCount(int