用户输入年份,判断该年份是否为闰年。

#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 不是闰年

最新文章

  1. SSH实例(1)
  2. [转]Servlet 中文乱码问题及解决方案剖析
  3. [NOI2007 Day1] 货币兑换 Cash
  4. javascript基于原型实现面向对象
  5. Java字符串转换
  6. linux下svn的常用代码【转】
  7. java泛型小总结
  8. Js判断是否是直接进入本页面的
  9. bzoj 2119: 股市的预测
  10. ArcGIS字段计算器分割字段中的字符串
  11. 测试一波SpringBoot的HTTP吞吐量
  12. PBRT笔记(5)——相机模型
  13. 使用AngularJS中的filterFilter函数进行过滤
  14. 一、数据库表中字段的增删改查,二、路由基础.三、有名无名分组.四、多app共存的路由分配.五、多app共存时模板冲突问题.六、创建app流程.七、路由分发.八、路由别名,九、名称空间.十、反向解析.十一、2.x新特性.十二、自定义转换器
  15. Linux中/etc/resolv.conf文件简析
  16. NSWindow添加NSViewController
  17. MDP中值函数的求解
  18. ny225 小明求素数积
  19. 5.7 Components — Sending Actions From Components to Your Application
  20. 每天一个linux命令(性能、优化):【转载】top命令

热门文章

  1. [SHOI2001] 小狗散步 - 二分图匹配
  2. Hive学习笔记二
  3. android 根据坐标返回触摸到的View
  4. AcWing 892. 台阶-Nim游戏
  5. Docker(二)Image 与网络
  6. springmvc 整合 redis
  7. centost redhat 卸载rpm以及yum install 的正确姿势
  8. 第五十四篇 Linux相关——远程连接SSH
  9. undefined 和 null
  10. 【转】git rebase详解