标签:
BufferedReader buf=new BufferedReader(new InputStreamReader(System.in)); // BufferedWriter buw=new BufferedWriter(new OutputStreamWriter(System.out));;//打印到控制台 BufferedWriter buw=new BufferedWriter(new OutputStreamWriter(new FileOutputStream("D:\\demo.txt")));//输出到文件 String line=null; while((line=buf.readLine())!=null) { if(line.equals("over")) { break; } buw.write(line.toUpperCase()); buw.newLine(); buw.flush(); }
标签:
原文地址:http://www.cnblogs.com/zywf/p/4769793.html