Run ID:110654
提交时间:2025-02-22 16:48:13
#include <iostream> using namespace std; // 判断年份是否为闰年 bool isLeapYear(int year) { if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { return true; } return false; } int main() { int year; cin >> year; // 读取年份 // 判断并输出结果 if (isLeapYear(year)) { cout << "leap year" << endl; } else { cout << "not leap year" << endl; } return 0; }