Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
65765 zyqll [在线测评解答教程] 闰年 C++ Accepted 2 MS 280 KB 582 2024-02-09 19:07:54

Tests(11/11):


Code:

#include <iostream> using namespace std; // 判断是否为闰年的函数 bool isLeapYear(int year) { if (year % 4 != 0) { return false; } if (year % 100 != 0) { return true; } if (year % 400 != 0) { return false; } return true; } int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int year; cin >> year; if (isLeapYear(year)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }