1284: 闰年
来源:互联网 发布:cctv发现之旅骗局知乎 编辑:程序博客网 时间:2024/05/22 17:20
题目
Description
输入年份判断是否是闰年,如果是则输出“yes”否则输出”no”
闰年规则为:四年一闰,百年不闰,四百年再闰;如2012为闰年,但1900年不是闰年,2000年是闰年哟。
Input
输入年份判断是否是闰年,
Output
如果是则输出“yes”否则输出”no”
Sample Input
1900
Sample Output
no
代码块
import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner cn = new Scanner(System.in); int n = cn.nextInt(); if(n%4==0&&n%100!=0||n%400==0) System.out.println("yes"); else System.out.println("no"); }}
阅读全文
0 0
- 1284: 闰年
- 1284:闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年?
- 闰年
- 闰年
- 闰年
- 闰年
- 闰年
- Html5学习笔记
- ABAP 查询性能提高之我见
- 显存 内存 使用量估计 卷积神经网络 convolution torch finput
- JSP指令及九大内置对象
- 怎么用运行命令mstsc连接到远程计算机
- 1284: 闰年
- realm 文件越来越大?那你需要注意一下了
- Queue CodeForces
- HashSet浅析
- 栈的基本操作(附带一个数据结构、C语言版)
- K-D Tree详解
- 3295: [Cqoi2011]动态逆序对
- TCPIP 网络科普 (james-lx)
- Spring(05)——基于XML配置的自动注入(autowire)