提交时间:2026-05-31 14:18:54

运行 ID: 443038

#include <iostream> using namespace std; int main() { int t; // 输入测试组数 cin >> t; while (t--) { // 循环 t 次 int year; cin >> year; // 核心:闰年判断公式 bool is_leap = false; if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { is_leap = true; } // 输出结果 if (is_leap) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }