import java.io.file;
import java.io.filewriter;
import java.io.printwriter;
import java.io.ioexception;
public class result {
private file result =new file("result.txt");
private filewriter writer;
private printwriter pw;
public result() {
try {
writer = new filewriter("result.txt");
pw=new printwriter(writer);
}
catch (ioexception iox){
system.err.println(iox);
}
}
public void aline(string in) { //写入一行
pw.println(in);
}
public void finish() { //关闭输入流,将文字从缓存写入文件
try{
pw.flush();
writer.close();
}catch (ioexception iox){
system.err.println(iox);
}
}
}