输出1000年---2000年之间的闰年


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

	printf("\ncount= %d ", count);
	system("pause");
	return 0;
}
发布了24 篇原创文章 · 获赞 0 · 访问量 317

猜你喜欢

转载自blog.csdn.net/qq_44828389/article/details/100567264