求一天是该年中的第几天
#include<iostream>
using namespace std;
void main()
{
int i,year,month,day,mdays[]={31,28,31,30,31,30,31,31,30,31,30,31},sum=0;
cout<<"请输入年、月、日:"<<endl;
cin>>year>>month>>day;
//对闰年的处理
if(year%4==0&&(year%100!=0||year%400==0))
sum+=1;
for(i=0;i<month-1;i++)
sum+=mdays[i];
cout<<year<<"年"<<month<<"月"<<day<<"日是"<<year<<"年的第"<<sum+day<<"天。"<<endl;
}