标签:
3 2000 4 5 2001 5 4 2010 10 24
96 124 297
#include<iostream>
using namespace std;
int n;
void data(int y,int m,int d)
{
switch(m)
{
case 2:
n=31+d;
break;
case 3:
n=59+d;
break;
case 4:
n=90+d;
break;
case 5:
n=120+d;
break;
case 6:
n=151+d;
break;
case 7:
n=181+d;
break;
case 8:
n=212+d;
break;
case 9:
n=242+d;
break;
case 10:
n=272+d;
break;
case 11:
n=303+d;
break;
case 12:
n=334+d;
break;
}
}
int main()
{
int N;
cin>>N;
for(int i=0;i<N;i++)
{
int n1=0;
int y,m,d;
cin>>y>>m>>d;
if(m==1)
{
cout<<d<<endl;
}
if((n%4 ==0 && n%100 != 0)||n%400 == 0)
{
data(y,m,d);
n1=n;
cout<<n1+1<<endl;
}
else
{
data(y,m,d);
n1=n;
cout<<n1<<endl;
}
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/chance88/p/4410397.html