洛谷P5711

题目:

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代表年。

猜你喜欢

转载自www.cnblogs.com/2019computer/p/12218275.html
今日推荐