赞
踩
- #include <stdio.h>
- int main()
- {
- int n = 1000,m = 2021;
- int year = n,sum = 0;
- printf("闰年有:\t");
- for(;year<=m;year++)
- {
- if(year%4==0 && year%100!=0 || year%400==0)
- {
- printf("%d\t",year);
- sum++;
- }
- }
- printf("\n从%d到%d间共有%d个闰年\n",n,m,sum);
- return 0;
- }
我是虎哥,大家多学习多交流
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。