[color=red][/color]package bean;
import java.util.Scanner;
public class lianxi {
public static void main(String []args){
Scanner scanner = new Scanner(System.in);
System.out.println("请输入年份:");[/color]
[color=green]int year =scanner.nextInt();//读取一个int值[/color]
if (year%4==0&&year %100!=0||year%400==0){
System.out.println(+year+"是闰年");
}else{
[color=red]System.out.println(+year+"不是闰年");[/color]}
}
}
//附件有截图
import java.util.Scanner;
public class lianxi {
public static void main(String []args){
Scanner scanner = new Scanner(System.in);
System.out.println("请输入年份:");[/color]
[color=green]int year =scanner.nextInt();//读取一个int值[/color]
if (year%4==0&&year %100!=0||year%400==0){
System.out.println(+year+"是闰年");
}else{
[color=red]System.out.println(+year+"不是闰年");[/color]}
}
}
//附件有截图