//闰年判断程序
public class LeapYear {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("请输入年份:");
int year = scan.nextInt();
boolean flag = (year%4==0 && year%100!=0)
||
year%400==0;
String str = flag ? year+"是闰年" : year+"不是闰年";
System.out.println(str);
}
}
闰年判断程序
最新推荐文章于 2023-07-21 17:45:16 发布