\\\\\\\\ 奇怪的错误 ,怪 怪怪怪 !!!!!请高手指出 \\\\\\\\\\\\\\\\
import java.io.*;
public class aa{
public static void main(String []args){
int flag = 0 ;
try{
do{
System.out.print("please input :");
flag = System.in.read() - '0' ;
System.out.println("flag = " + flag);
}while(flag<100) ;
}catch(IOException e){
System.out.println(e.toString());
}
}
}
输出结果为:
please input :1
flag = 1
please input :flag = -35
please input :flag = -38
please input :2
flag = 2
please input :flag = -35
please input :flag = -38
please input :
为什么循环一次,输出却为 3 此 ???????