问答题

下列程序中,要求从键盘接受字符输入,直到输入字符为“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 Joe)
System._______;

【参考答案】

(char)System.in.read()
out.print(ch)
out.println(ioe.g......

(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
热门 试题