help me!!半对 995!!!
查看原帖
help me!!半对 995!!!
1393947
km18670090557楼主2025/7/25 17:37
#include<bits/stdc++.h>
using namespace std;
int n,x,a[10001];
bool y(int x){
	if (x%4==0&&x%100!=0||x%400==0) return 1;
    else return 0;
}
int main() {
	cin>>n>>x;
    for(int i=1;i<=12;i++){
        if(i==2){
            if(y(n)) a[i]=29;
            else a[i]=28;
        }
        else if(i==8) a[i]=31;
        else if(i%2==1) a[i]=31;
        else a[i]=30;
}
    cout<<a[x];
	return 0;
}
2025/7/25 17:37
加载中...