输出1000 ——2000的闰年
来源:互联网 发布:linux 命令行输出结果 编辑:程序博客网 时间:2024/04/29 17:56
#include<stdio.h>
int main()
{
int year =0;
int count=0;
for(year = 1000;year<=2000;year++)
{
if(year%4==0)
{
if(year%100 !=0)
{
count++;
printf("%d ",year);
}
}
if(year%400==0)
{
count++;
printf("%d ",year);
}
}
printf("\ncount=%d\n",count);
return 0;
int main()
{
int year =0;
int count=0;
for(year = 1000;year<=2000;year++)
{
if(year%4==0)
{
if(year%100 !=0)
{
count++;
printf("%d ",year);
}
}
if(year%400==0)
{
count++;
printf("%d ",year);
}
}
printf("\ncount=%d\n",count);
return 0;
}
通过if语句判断是否为闰年,注意括号的用法
0 0
- 输出1000 ——2000的闰年
- 输出1000—2000年之间的所有闰年
- 输出1000-2000的闰年
- 输出1000到2000之间的闰年
- C语言 判断1000年---2000年之间的闰年,并输出闰年
- C语言如何求闰年,打印输出1000-2000年之间的所有闰年.
- 输出1000到2000年的闰年的年份
- 编写程序输出1000~2000之间的闰年
- 输出1000到2000的闰年年份及个数
- 判断1000-2000年之间的闰年,并输出
- 判断并输出1000-2000之间的闰年
- 【c语言】判定2000—2500年中的每一年是否为闰年,并输出结果
- 输出1000-1999之间的闰年
- 输出1000到200之间的闰年
- 输出2000-3000年之间的闰年
- 输出2000到2014之间的闰年
- 闰年的输出
- 闰年的输出
- 数字字符串是否为合法IP地址
- 一种更清晰的Android架构
- SpringMVC源码剖析(五)-消息转换器HttpMessageConverter
- 【译】Android开发中的MVP架构
- 蓝桥杯初赛9
- 输出1000 ——2000的闰年
- 10种可提高应用在Google Play上的曝光率的正确做法
- 关于响应式布局
- 【译】Android应用架构
- Android权限大全
- leetcode---Maximum Depth of Binary Tree
- Android中软键盘弹出可能遮挡布局
- TCP/IP协议栈概述及各层包头分析
- com.google.gson.internal.StringMap cannot be cast XXX