#include <iostream>
using namespace std;
struct Date {
int year;
int month;
int day;
};
bool isLeapYear(int year)
{
return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}
int days(const Date& date)
{
int month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int total= 0;
if (isLeapYear(date.year))
{
month[2] = 29;
}
for (int i = 1; i < date.month; i++) {
total += month[i];
}
total += date.day;
return total;
}
int main()
{
Date date;
cout << "请输入年、月、日:";
cin >> date.year >> date.month >> date.day;
int result = days(date);
cout << "该日在本年中是第 " << result << " 天" << endl;
return 0;
}