#include<iostream> using namespace std; int Monthday[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int main() { int N; cin>>N; while(N--) { int year,month,day; cin>>year>>month>>day; int result=0; for(int i=0;i<=month-2;i++) { result+=Monthday[i]; } result+=day; if((year%4==0&&year%100!=0)||year%400==0) { if(month>2) result++; } cout<<result<<endl; } }
计算润年
计算日期
时间: 2024-10-19 20:56:25