testnumber.java

来自「java练习的源代码」· Java 代码 · 共 42 行

JAVA
42
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package number;/** * * @author china */public class TestNumber {    /**     * @param args the command line arguments     */    public static void isLeapYear(int year)    {        boolean n1=(year%4==0);        boolean n2=(year%100==0);        boolean n3=(year%400==0);        if((n1==true&&n2!=true)|| (n2==true&&n3==true))        {            System.out.println(year+"年是瑞年");        }        else {            System.out.println(year+"年不是瑞年");                    }                        }    public static void main(String[] args) {        // TODO code application logic here      isLeapYear(1900);      isLeapYear(1904);      isLeapYear(2000);            }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?