代码比较简单,直接贴出了
public class outputStreamClass {
public static void main(String[] args) throws IOException {
//createFile();
createFileAndLineFeed();
}
public static void createFileAndLineFeed() throws IOException {
FileOutputStream fos=new FileOutputStream("D:\java idea\A.txt",true);
for(int i=1;i<=9;i++){
for(int j=1;j<=i;j++){
String x=j+"*"+i+"="+i*j+" ";
fos.write(x.getBytes(StandardCharsets.UTF_8));
}
fos.write("rn".getBytes(StandardCharsets.UTF_8));}
fos.close();
}
}



