import java.util.Scanner;
public class a4 {
public static void main(String[] args) {
Scanner inputYear = new Scanner(System.in);
while (inputYear.hasNext()) {
int iyear = inputYear.nextInt();
if (iyear % 4 == 0 && iyear % 100 != 0 || iyear % 400 == 0) {
System.out.println("閏年");
} else {
System.out.println("平年");
}
}
inputYear.close();
}
}
import java.util.Scanner;
public class a4 {
public static void main(String[] args) {
Scanner inputYear = new Scanner(System.in);
while (inputYear.hasNext()) {
int iyear = inputYear.nextInt();
if (iyear % 4 == 0 && iyear % 100 != 0 || iyear % 400 == 0) {
System.out.println("閏年");
} else {
System.out.println("平年");
}
}
inputYear.close();
}
}
剛剛又測試了一下 可以了 感謝
import java.util.Scanner;
public class a4 {
public static void main(String[] args) {
Scanner inputYear = new Scanner(System.in);
while (inputYear.hasNext()) {
int iyear = inputYear.nextInt();
if (iyear % 4 == 0 && iyear % 100 != 0 || iyear % 400 == 0) {
System.out.println("閏年");
} else {
System.out.println("平年");
}
}
inputYear.close();
}
}
剛剛又測試了一下 可以了 感謝
簡單
import java.util.Scanner;
public class a4 {
public static void main(String[] args) {
Scanner inputYear = new Scanner(System.in);
while (inputYear.hasNext()) {
int iyear = inputYear.nextInt();
if (iyear % 4 == 0 && iyear % 100 != 0 || iyear % 400 == 0) {
System.out.println("閏年");
} else {
System.out.println("平年");
}
}
inputYear.close();
}
}
簡單