#include <cstdio>
using namespace std;
int mon[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int cal(int y, int m)
{
if(m != 2) return mon[m];
return mon[2]+((y%4==0 && y%100!=0) || y%400==0);
}
int main()
{
int t;
cin >> t;
while(t--)
{
int y, m, d, yy, mm, dd;
scanf("%d%d%d", &y, &m, &d);
scanf("%d%d%d", &yy, &mm, &dd);
int num = max(0, yy-y-1)/400;
int ans = num*(365*400+97);
y += 400*num;
while(1) {
if(y == yy && m == mm && d == dd) break;
ans++;
d++;
if(d > cal(y, m)) {
...
继续阅读
(43)