首页 > 其他 > 详细

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

时间:2016-06-14 19:47:07      阅读:198      评论:0      收藏:0      [点我收藏+]
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int year=0;
	int count=0;   //计算有多少个闰年
	for(year=1000;year<=2000;year++)
	{
		if((year%4==0&&year%100!=0)||(year%400==0))
		{
			printf("%5d",year);
			count++;
		}
	}
	printf("\n");
	printf("%d\n",count);
	system("pause");
	return 0;
}

技术分享

本文出自 “岁月静好” 博客,请务必保留此出处http://01160529.blog.51cto.com/11479142/1789161

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

原文:http://01160529.blog.51cto.com/11479142/1789161

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!