Scanner scanner = new Scanner(System.in); while(scanner.hasNext()){ int t = scanner.nextInt(); if((t%4==0 && t%100!=0) || t%400==0){ System.out.println("閏年"); }else{ System.out.println("平年"); } }