【牛客】---判断闰年

【牛客】---判断闰年

题目链接

题目描述
判断一个整数n是否是闰年

输入描述:
输入一个整数n (1≤n≤2018)

输出描述:
是闰年输出"yes" 否则输出"no"

#include<iostream>
using namespace std;
int main() {
	int n;
	cin >> n;
	if ((n%4==0&&n%100!=0)||n%400==0)
	{
		cout << "yes";
	}
	else
	{
		cout << "no";
	}
	return 0;
}
posted @ 2023-01-14 09:50  、怪咖  阅读(83)  评论(0)    收藏  举报