class demoWhile{
public static void main(String args[])
throws java.io.IOException{
char ch = (char)System.in.read();
while(ch!='w'){
System.out.println("Hi"+ch);
ch = (char)System.in.read();
}
}
}
Run Code Online (Sandbox Code Playgroud)
- 首先我给输入"R"和预期产量"的HIR",然后输入选项,而是获得产量的HIR,嗨,嗨然后输入选项.为什么它会显示两个额外的Hi,嗨?