Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118354 李茗宇 08有几个闰年 C++ Accepted 1 MS 272 KB 375 2025-04-27 20:58:25

Tests(10/10):


Code:

#include <iostream> bool isLeapYear(int year) { return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0); } int main() { int a, b, c; std::cin >> a >> b >> c; int count = 0; if (isLeapYear(a)) count++; if (isLeapYear(b)) count++; if (isLeapYear(c)) count++; std::cout << count << std::endl; return 0; }