作业帮 > 综合 > 作业

用if……else if ……else 语句实现输入某年某月某日,计算出这一天是该年的第几天?例如以2010年3月10日

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/05/28 15:04:42
用if……else if ……else 语句实现输入某年某月某日,计算出这一天是该年的第几天?例如以2010年3月10日为例,应该先把前两个月的天数加起来,然后再加上10天得到62天即本年的第几天,特殊情况,闰年且输入的月份大于3时需考虑多加一天.
用if……else if ……else 语句实现输入某年某月某日,计算出这一天是该年的第几天?例如以2010年3月10日
#include
using namespace std;
int main()
{int sum_day(int,int);
int leap(int year);
int year,month,day,days=0;
coutyear>>month>>day;
cout