题目链接

日期问题,直接套模板

#include<bits/stdc++.h>
using namespace std;
int month[13][2]={{0,0},{31,31},{28,29},{31,31},{30,30},{31,31},{30,30},{31,31},{31,31},{30,30},{31,31},{30,30},{31,31}};
bool isLeap(int y){
	return (y%4==0&&y%100!=0)||(y%400)==0;
}
int main(){
	int n,y,m,d; 
	while(cin>>n){
		while(n--){
			cin>>y>>m>>d;
			int k=0;
			int mm=1,dd=0;
			int u = isLeap(y);
			while(mm!=m || dd!=d){
				dd++;
				if(dd == month[mm][u] + 1){
					mm++;
					dd=1;
				}
				k++;
			}
			cout<<k<<endl;
		}
	}
	
	return 0;
}