下面是代码
public static void main(String[] args) throws IOException {
File file = new File("stu.txt");
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
for(int i = 1; i <= 9; i ++) {
for(int j = 1; j <= i; j ++) {
String str = " j + * i = + ( i * j) ";
bos.write(str.getBytes());
bos.write("\t".getBytes());
}
bos.write("\r\n".getBytes());
}
bos.close();
}
打印出来的只是字符啊,该怎么把 i 和 j 传到里面去啊 |
|