在程序里边,不是人工
追答public class test{
public void test1(){
Scanner sc = null;
try{
sc = new Scanner(System.in);
System.out.println("请输入数:");
String num1 = sc.next();
while(!num1.equals("1")){
System.out.println("输入错误,请重新输入:");
num1=sc.next();
}
System.out.println("恭喜你,输入正确"+num1);
}catch(Exception e){
e.printStackTrace();
}finally{
sc.close();
}
public static void main(String[] args){
test t = new test();
}
}
是这个意思吗