数学高手进来帮帮忙看看完善下这个码吧@_@!
#include "iostream.h"int main()
{
int a,b,c;
char aper,count;
cout<<"输入日期(如:2005-2-8):";
cin>>a>>aper>>b>>count>>c;
cout<<a<<aper<<b<<count<<c<<endl;
switch ((a+3)/4-a/4&&(a/400+3)-a/400&&(a+399)/400-a/400)
{
case 0:
if(b==1&&c&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c<<"天!"<<endl;
else
{
if(b==2&&c<=29) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+31<<"天!"<<endl;
else
{
if(b==3&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+60<<"天!"<<endl;
else
{
if(b==4&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+91<<"天!"<<endl;
else
{
if(b==5&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+121<<"天!"<<endl;
else
{
if(b==6&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+152<<"天!"<<endl;
else
{
if(b==7&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+182<<"天!"<<endl;
else
{
if(b==8&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+213<<"天!"<<endl;
else
{
if(b==9&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+244<<"天!"<<endl;
else
{
if(b==10&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+274<<"天!"<<endl;
else
{
if(b==11&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+305<<"天!"<<endl;
else
{
if(b==12&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是闰年"<<a<<"年的第"<<c+335<<"天!"<<endl;
else cout<<"错误日期!"<<endl;
}
}
}
}
}
}
}
}
}
}
}
break;
case 1:
if(b==1&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c<<"天!"<<endl;
else
{
if(b==2&&c<=28) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+31<<"天!"<<endl;
else
{
if(b==3&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+59<<"天!"<<endl;
else
{
if(b==4&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+90<<"天!"<<endl;
else
{
if(b==5&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+120<<"天!"<<endl;
else
{
if(b==6&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+151<<"天!"<<endl;
else
{
if(b==7&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+181<<"天!"<<endl;
else
{
if(b==8&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+212<<"天!"<<endl;
else
{
if(b==9&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+243<<"天!"<<endl;
else
{
if(b==10&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+273<<"天!"<<endl;
else
{
if(b==11&&c<=30) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+304<<"天!"<<endl;
else
{
if(b==12&&c<=31) cout<<a<<"年"<<b<<"月"<<c<<"日是平年"<<a<<"年的第"<<c+334<<"天!"<<endl;
else cout<<"错误日期!"<<endl;
}
}
}
}
}
}
}
}
}
}
}
break;
}
return 0;
}