Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
441978 王程之 [在线测评解答教程] 闰年 C++ 通过 100 1 MS 252 KB 571 2026-05-26 16:41:38

Tests(1/1):


#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; }


测评信息: