import java.io.*;
public class Bwriter
{
public static void main(String args[]) throws Exception
{
InputStreamReader i = new InputStreamReader(System.in);
BufferedReader b = new BufferedReader(i);
FileWriter f = new FileWriter("file1.txt");
BufferedWriter w = new BufferedWriter(f);
String s;
while(true)
{
System.out.print("input a string");
System.out.flush();
s = b.readLine();
if(s.length()==0)
break; //如果用户直接回车,代表结束
w.write(s);
w.newLine();
}
w.close();
}
public class Bwriter
{
public static void main(String args[]) throws Exception
{
InputStreamReader i = new InputStreamReader(System.in);
BufferedReader b = new BufferedReader(i);
FileWriter f = new FileWriter("file1.txt");
BufferedWriter w = new BufferedWriter(f);
String s;
while(true)
{
System.out.print("input a string");
System.out.flush();
s = b.readLine();
if(s.length()==0)
break; //如果用户直接回车,代表结束
w.write(s);
w.newLine();
}
w.close();
}
}