import java.util.*; public class LeapYear{ public static void main(String [] args){ Scanner input=new Scanner(System.in); System.out.print("请输入需要查询的年份:"); int year=input.nextInt();//将键盘输入的值赋值给year变量 if(year%4==0&&year%100!=0||year%400==0){ System.out.println(year+"年是闰年。"); }else{ System.out.println(year+"年是平年。"); } } }
原文地址:https://www.cnblogs.com/fqqwz/p/11625210.html
时间: 2024-10-02 20:22:24