3 2000 4 5 2001 5 4 2010 10 24
96 124 297
01.
#include<iostream>
02.
#include<cstdio>
03.
#include<string>
04.
#include<cstring>
05.
#include<cmath>
06.
#include<algorithm>
07.
using
namespace
std;
08.
int
t[12]={31,28,31,30,31,30,31,31,30,31,30,31};
09.
10.
int
main(
int
argc,
char
*
argv[])
11.
{
12.
int
n;
13.
cin>>n;
14.
while
(n--)
15.
{
16.
int
y,m,d,k,i;
17.
cin>>y>>m>>d;
18.
k=0;
19.
if
(m==1) cout<<d<<endl;
20.
else
if
(m==2)
21.
{
22.
k=d+t[0];
23.
cout<<k<<endl;
24.
}
25.
else
26.
{
27.
for
(i=0;i<m-1;i++)
28.
k+=t[i];
29.
if
(y%4==0&&y%100||y%400==0&&m>2)
30.
k=k+d+1;
31.
else
32.
k=k+d;
33.
cout<<k<<endl;
34.
}
35.
36.
}
37.
return
0;
38.
}
原文:http://www.cnblogs.com/52Cyan/p/3690075.html