Run ID:139895

提交时间:2025-12-11 15:14:11

#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>12 ) { cout << "Invalid."; } else{ cout << 31; } return 0; }