这是什么情况?
查看原帖
这是什么情况?
1426031
Yezi_damn楼主2024/8/22 16:16

翻出了尘封已久的未完成题目

94 pts code:

#include<bits/stdc++.h>
using namespace std;
int n[13]={31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
	int a,b;
	cin>>a>>b;
	if(!(a%4)&&a%400&&a%100&&b==2) cout<<29;
	else cout<<n[b-1];
}

错误原因(maybe)闰年判断有误,但貌似不是这个原因

2024/8/22 16:16
加载中...