import java.util.*;
public class Text4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int year;
int newyear;
int finaly;
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
year = cin.nextInt();
newyear = year % 4;
if(newyear == 0) {
finaly = newyear%100;
if(finaly == 0) {
System.out.println("平年");
}else {
System.out.println("閨年");
}
}else {
System.out.println("平年");
}
}
}
}
請問 .. 為什麼我不管怎麼輸入都是 "平年".
import java.util.*;
public class Text4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int year;
int newyear;
int finaly;
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
year = cin.nextInt();
newyear = year % 4;
if(newyear == 0) {
finaly = newyear%100;
if(finaly == 0) {
System.out.println("平年");
}else {
System.out.println("閨年");
}
}else {
System.out.println("平年");
}
}
}
}
請問 .. 為什麼我不管怎麼輸入都是 "平年".
import java.util.*;
public class Text4 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int year;
int newyear;
int finaly;
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
year = cin.nextInt();
newyear = year % 4;
if(newyear == 0) {
finaly = newyear%100;
if(finaly == 0) {
System.out.println("平年");
}else {
System.out.println("閨年");
}
}else {
System.out.println("平年");
}
}
}
}
請問 .. 為什麼我不管怎麼輸入都是 "平年".