C 语言实例 - 判断闰年
2024-09-04 02:46:54
用户输入年份,判断该年份是否为闰年。
#include <stdio.h> int main()
{
int year; printf("输入年份: ");
scanf("%d",&year); if(year% == )
{
if( year% == )
{
// 这里如果被 400 整数是闰年
if ( year% == )
printf("%d 是闰年", year);
else
printf("%d 不是闰年", year);
}
else
printf("%d 是闰年", year );
}
else
printf("%d 不是闰年", year); return ;
}
运行结果:
输入年份: 1990
1990 不是闰年
最新文章
- SSH实例(1)
- [转]Servlet 中文乱码问题及解决方案剖析
- [NOI2007 Day1] 货币兑换 Cash
- javascript基于原型实现面向对象
- Java字符串转换
- linux下svn的常用代码【转】
- java泛型小总结
- Js判断是否是直接进入本页面的
- bzoj 2119: 股市的预测
- ArcGIS字段计算器分割字段中的字符串
- 测试一波SpringBoot的HTTP吞吐量
- PBRT笔记(5)——相机模型
- 使用AngularJS中的filterFilter函数进行过滤
- 一、数据库表中字段的增删改查,二、路由基础.三、有名无名分组.四、多app共存的路由分配.五、多app共存时模板冲突问题.六、创建app流程.七、路由分发.八、路由别名,九、名称空间.十、反向解析.十一、2.x新特性.十二、自定义转换器
- Linux中/etc/resolv.conf文件简析
- NSWindow添加NSViewController
- MDP中值函数的求解
- ny225 小明求素数积
- 5.7 Components — Sending Actions From Components to Your Application
- 每天一个linux命令(性能、优化):【转载】top命令