打印1000到2000之间的闰年

#include  <stdio.h>

int main()

{
int i = 0;
for (i = 1000; i <= 2000; i++)
{
if (i % 4 == 0 && i % 100 != 0)
{
printf("%d  ", i);
}
else if (i % 400 == 0)
{
printf("%d  ", i);
}
}
system("pause");
return 0;
}

猜你喜欢

转载自blog.csdn.net/zhang_ting0020/article/details/79974991