✔ 最佳答案
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class play {
public static void main (String[] arg){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = br.readLine();
while (input != null){ // reading the words
if (input.equals("1")||input.equals("2")||input.equals("3")||input.equals("4")||input.equals("5")||input.equals("9")){
//input that is good
break;//break while loop when input matches condition
}
else{}//input that is bad or alphabets
}
}catch (IOException e) {System.out.println("error read file");}
}
}