package cast;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class ScnnerTest3 {
public static void main(String[] args) throws IOException {
Scanner sc=new Scanner(System.in);
BufferedWriter bw=new BufferedWriter(new FileWriter("i:\\c.txt"));
String line=null;
while((line=sc.nextLine())!=null){
if(line.equals("over")){
break;
}
bw.write(line);
bw.newLine();
bw.flush();
}
bw.close();
sc.close();
}
} |
|