#include "stdafx.h"
#include<iostream>;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int n;
cout << "请输入一个年份" << endl;
cin >> n;
if (n % 4 == 0 && n % 100 != 0||n%400==0) //能被4整除,并且 不能被100整除。
{
cout << n << "年是闰年" << endl;
}
else
{
cout << n << "年不是闰年" << endl;
}
return 0;
}
判断闰年
最新推荐文章于 2023-12-10 22:13:08 发布