本帖最后由 崔利鹏 于 2012-11-15 08:54 编辑
//输出output()
public void output() throws IOException {
FileWriter fw = new FileWriter("D://stu.txt");
BufferedWriter bw = new BufferedWriter(fw);
bw.write("name" + "score1" + "score2" + "score3");
bw.newLine();
for (int i = 0; i < 5; i++) {
bw.write(" " + name);
for (int j = 0; j < 3; j++)
bw.write(" " + score[j]);
bw.newLine();
}
bw.close();
}
|