Run ID:145419
提交时间:2026-01-25 15:10:53
#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; }