题目:
https://www.luogu.com.cn/problem/P5711?contestId=25166
主要分析:使用if条件语句。
以下是闰年的判断方法:
https://zhidao.baidu.com/question/297846777.html
代码如下:
#include <bits/stdc++.h>
using namespace std;
int y;
int main() {
cin>>y;
if((y%4==0&&y%100!=0)||y%400==0)
cout<<"1"<<endl;
else cout<<"0"<<endl;
return 0;
}
注意:y代表年。
浙公网安备 33010602011771号