Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
145419 徐毅然 09闰年第n个月有多少天 C++ Accepted 0 MS 276 KB 390 2026-01-25 15:10:53

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; // 判断输入是否合法 if (n < 1 || n > 12) { cout << "Invalid." << endl; return 0; } // 闰年中各个月份的天数 int days[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; cout << days[n-1] << endl; return 0; }