考虑闰年2月情况
2026-01-31 13:54:20
发布于:浙江
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int y,m;
cin>>y>>m;
if(y%4==0&&m==2&&y%100!=0) cout<<29;
else if(y%400==0&&m==2) cout<<29;
else{int arr[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
cout<<arr[m];
}
return 0;
}
这里空空如也






有帮助,赞一个