Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
108931 | 彭士宝 | [在线测评解答教程] 闰年 | C++ | Accepted | 1 MS | 272 KB | 482 | 2025-01-23 16:41:15 |
#include <iostream> using namespace std; bool isLeapYear(int year) { if (year % 400 == 0) return true; if (year % 100 == 0) return false; return (year % 4 == 0); } int main() { int t; cin >> t; // 读取测试样例的数量 while (t--) { int n; cin >> n; // 读取年份 if (isLeapYear(n)) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }