Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
4152 测试1 [在线测评解答教程] 闰年 C++ Accepted 0 MS 264 KB 498 2024-08-12 01:15:47

Tests(11/11):


Code:

#include <iostream> using namespace std; int main() { int t; cin >> t; // 读取样例组数 while (t--) { int n; cin >> n; // 读取年份 // 判断是否是闰年 if ((n % 4 == 0 && n % 100 != 0) || (n % 400 == 0)) { cout << "Yes" << endl; // 是闰年,输出Yes } else { cout << "No" << endl; // 不是闰年,输出No } } return 0; }