20求助
查看原帖
20求助
1053122
shy_lihui楼主2023/9/4 20:39
#include<bits/stdc++.h> 
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b;
	bool f=1;
	if (a%4==0 && a%100!=0 || a%400==0 ) f=1;
	else f=0;
	if(b==1 ||b==3||b==5||b==7||b==8||b==10||b==12) c=1;
	else if(b==4 ||b==6||b==9||b==11) c=2;
	else c=3;
	if(f=0){
		if(c=1) cout<<31;
		else if(c=2) cout<<30;
		else if(c=3) cout<<28;
	}
	else{
		if(c=1) cout<<31;
		else if(c=2) cout<<30;
		else if(c=3) cout<<29;
	}
	return 0;
}
 
2023/9/4 20:39
加载中...