输出1000到2000的闰年

#include<stdio.h>
int main()
{
    int i;
    for (i = 1000; i <= 2000; i++)
        if ((i % 4 == 0 &&i % 100!= 0) ||i % 400 == 0)
        {
            printf("%d ", i);
        }

    system("pause");
    return 0;
}

这里写图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40853073/article/details/79988425