C++1949到2022的闰年
作者:互联网
#include <iostream>
#include <cmath>
using namespace std;
bool isRunnian(int);
int main()
{
int i;
for(i=1900; i<=2020; i++)
{
if(isRunnian(i))
{
cout<<i<<'\t';
}
}
return 0;
}
bool isRunnian(int y)
{
if((y%400==0)||(y%4==0)&&(y%100!=0))
{
return true;
}
else
return false;
}
标签:1949,return,int,y%,C++,2022,isRunnian,false,include 来源: https://blog.csdn.net/weixin_51188609/article/details/122269151