80求助,4点WA
查看原帖
80求助,4点WA
680434
shumu楼主2023/9/10 10:50
#include<bits/stdc++.h>
using namespace std;
int main() {
	int year,mouth;
	cin>>year>>mouth;
	if(mouth==1||mouth==3||mouth==5||mouth==7||mouth==8||mouth==10||mouth==12) {
		cout<<"31";
	}
	else if(mouth==2) {
		 if((year%4==0&&year!=100)||year%400==0) {
		 	cout<<"29";
		 }
		 else {
		 	cout<<"28";
		 }
	}
	else {
		cout<<"30";
	}
}
2023/9/10 10:50
加载中...