首页上一页 1 下一页尾页 3 条记录 1/1页
如:
while((numGuess!=numRand)&&(numGuess>=0)&& (numGuess !== exp[0-9] )){ //这里我想排除非法字符
if(numGuess>numRand){
System.out.println("你猜的数字太大了,请重新猜测!");
numGuess=in.nextInt();
}else if(numGuess<numRand){
System.out.println("你猜的数字太小了,请重新猜测!");
numGuess=in.nextInt();
}else{
System.out.println("你猜的不是数字,请重新猜测!");
numGuess=in.nextInt();
}
}
while((numGuess!=numRand)&&(numGuess>=0)&& (numGuess !== exp[0-9] )){ //这里我想排除非法字符
if(numGuess>numRand){
System.out.println("你猜的数字太大了,请重新猜测!");
numGuess=in.nextInt();
}else if(numGuess<numRand){
System.out.println("你猜的数字太小了,请重新猜测!");
numGuess=in.nextInt();
}else{
System.out.println("你猜的不是数字,请重新猜测!");
numGuess=in.nextInt();
}
}
于2016-11-25 15:13:04编辑