日期:2014-05-20 浏览次数:20924 次
public static void main(String[] args) throws Exception {
char ch = ' ';
while (true) {
ch = (char) System.in.read();
if (ch == '\r') {
System.out.println("输出/r");
} else if (ch == '\n') {
System.out.println("输出/n");
} else {
System.out.println("你输入的字符是:" + ch);
}
if (ch == 'x')
break;
}
System.out.println("程序已经退出!");
}