📄 ex3_1.java
字号:
import java.io.*;
public class ex3_1
{
public static void main(String[ ] args) throws IOException
{ int year;
boolean IsLeapYear;
System.out.println("Enter the year:");
BufferedReader in =new BufferedReader(
new InputStreamReader(System.in));
year=(new Integer(in.readLine())).intValue();
IsLeapYear=((year%4==0 && year%100 != 0)||(year%400 == 0));
if (IsLeapYear)
{ System.out.print(year);
System.out.println( "is a leap year");
}
else
{ System.out.print(year);
System.out.println( "is not a leap year");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -