【牛客】---判断闰年
【牛客】---判断闰年
题目描述
判断一个整数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;
}

浙公网安备 33010602011771号