本帖最后由 够了没有 于 2013-11-23 17:54 编辑
import java.io.*;
class SystemStreamDemo {
public static void main(String[] args) throws IOException {
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bufw = new BufferedWriter(new OutputStreamWriter(System.out));
String line = null;
while((line=bufr.readLine())!=null){
if(line.equals("over")){
break;
}
bufw.write(line.toUpperCase());
bufw.newLine();
bufw.flush();
}
bufr.close();
bufw.close();
}
}
===================================================================
运行结果这样:
haha
HAHA
hehe
HEHE
哈哈
HA'HAH哈哈
===================================================================我只要一输入中文,输出结果就要奔溃,这是为啥?
|