Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139891 胡海峰老师 09闰年第n个月有多少天 C++ Wrong Answer 0 MS 276 KB 570 2025-12-11 15:01:31

Tests(1/10):


Code:

#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; }


Run Info:

------Input------
0
------Answer-----
Invalid.
------Your output-----
invalid