| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139892 | 胡海峰老师 | 09闰年第n个月有多少天 | C++ | Accepted | 0 MS | 272 KB | 571 | 2025-12-11 15:01:57 |
#include <iostream> //designed by hu 2025-10 using namespace std; int main(){ //Month( 4,6,9,11)----> 30 Days //Month( 2 )----> 29 Days //Month( 1,3,5,7,8,10,12)----> 30 Days int n; // 1- 12(valid合法) ,不在这个区间(invalid 非法) cin >> n; //从键盘输入一个月份 if( n==2) { cout << 29; } else if( n==4 || n==6 || n==9 || n==11) { cout << 30; } else if( n==1 || n==3 || n==5 || n==7 || n==8 || n==10 || n==12 ) { cout << 31; } else{ cout << "Invalid."; } return 0; }