| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 85541 | 彭士宝 | 08判断是否为闰年 | C++ | Wrong Answer | 1 MS | 272 KB | 446 | 2024-07-17 20:10:01 |
#include <iostream> #include <string> using namespace std; string is_leap_year(int year) { if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { return to_string(year) + " Yes"; } else { return to_string(year) + " No"; } } int main() { int year; cout << "Enter the year: "; cin >> year; string result = is_leap_year(year); cout << result << endl; return 0; }
------Input------
3264
------Answer-----
3264 Yes
------Your output-----
Enter the year: 3264 Yes