基本操作题
下列程序中,要求从键盘接受字符输入,直到输入字符为"e"(注意是小写)时停止,并且将输入的字符("e"之前的字符)显示在屏幕上。请将程序补充完整。
程序运行结果如下:
Keep typing, it will stop while enter ’’e’’...
ddfsofkjlvncozieowdsfadsf
ddfsofkjlvncozi
import java.io.*;
public class ex4_1 {
public static void main(String[] args) {
char ch;
System.out.println("Keep typing,it will stop while enter ’’e’’...");
try{
while((ch= )!=’’e’’){
System. ;
}
}catch(IOException ioe){
System. ;
}
}
}