#include <iostream>
using namespace std;
const int DAYS[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool isLeapyear(int year)
{
if(year%100)
if(year%4==0)return true;
else return false;
else
if(year%400==0)return true;
else return false;
}
int main()
{
int n;
cin>>n;
while(n--)
{
int y, m, d;
cin>>y>>m>>d;
int s = 0;
if(isLeapyear(y)&&m>2)s++;
for(int i = 0; i < m-1; i++)
s+=DAYS[i];
s+=d;
cout<<s<<endl;
}
return 0;
}
日期计算
最新推荐文章于 2021-01-18 18:39:32 发布