日期:2014-05-20 浏览次数:20881 次
import java.util.*;
public class SwitchCaseDemo {
public static void main(String[] args) {
int score;
while(true) {
boolean isInt=true;
Scanner console = new Scanner(System.in);
try {
score = console.nextInt();
}catch (InputMismatchException e) {
isInt=false;
System.out.println("格式不正确,从新再输入:");
}
if(isInt)
break;
}
}
}