import java.io.*;
public class AdamHmwk4 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int counter1;
int counter2;
int counter3;
String answer = "";
System.out.println("Welcome to Adam's skip-counting program!");
System.out.println("Please input the number you would like to skip count by.");
counter1 = Integer.parseInt(br.readLine());
if (answer.equals(counter1)) {
System.out.println("Please input the number you would like to start at.");
counter2 = Integer.parseInt(br.readLine());
if (answer.equals(counter2)) {
System.out.println("Please input the number you would like to stop at.");
counter3 = Integer.parseInt(br.readLine());
if (answer.equals(counter3)) {
System.out.println("This is skip counting by");
System.out.println(counter1);
System.out.println(",starting from");
System.out.println(counter2);
System.out.println("and ending at");
System.out.println(counter3);
}
}
}
}
}
当我编译并运行这段代码时,第一部分执行得很好,但是当我为它输入一个数字时,下一个用户输入部分不显示。请记住,我是 Java 新手。