#include <iostream>
using namespace std;
int main()
{
int year;
bool isLeapYear;
cout << "请输入年份:";
cin >> year;
isLeapYear = ((year % 4 ==0 && year % 100 != 0) || (year % 400 == 0));
if(isLeapYear)
cout << year << "是闰年";
else
cout << year << "是平年";
}
C++ 判断年份是否为闰年
最新推荐文章于 2024-03-02 09:57:24 发布