#include<iostream>
using namespace std;
int main()
{
int a,b,c,m;
cout<<"please enter a date:"<<endl;
cin>>a>>b>>c;
if(a>=0)
{
if(b==1&&c>=1&&c<=31)
m=c;
else if(b==2)
{
if(a%4==0&&a%400==0&&c<=29)
m=31+c;
else if(c<=28)
m=31+c;
}
else if(b>2&&b<=12)
{
if(a%4==0&&a%400==0&&c<=31)
m=31+29+(b-2)*31+c;
else if(a%4!=0||a%400!=0&&c<=31)
m=31+28+(b-2)*31+c;
}
cout<<a<<"."<<b<<"."<<c<<"是这一年的第"<<m<<"天。"<<endl;
}
else
cout<<"Error date!"<<endl;
return 0;
}
using namespace std;
int main()
{
int a,b,c,m;
cout<<"please enter a date:"<<endl;
cin>>a>>b>>c;
if(a>=0)
{
if(b==1&&c>=1&&c<=31)
m=c;
else if(b==2)
{
if(a%4==0&&a%400==0&&c<=29)
m=31+c;
else if(c<=28)
m=31+c;
}
else if(b>2&&b<=12)
{
if(a%4==0&&a%400==0&&c<=31)
m=31+29+(b-2)*31+c;
else if(a%4!=0||a%400!=0&&c<=31)
m=31+28+(b-2)*31+c;
}
cout<<a<<"."<<b<<"."<<c<<"是这一年的第"<<m<<"天。"<<endl;
}
else
cout<<"Error date!"<<endl;
return 0;
}