java储存九九乘法口诀

 1 //储存九九乘法口诀
 2 package classwork10;
 3 
 4 import java.io.FileNotFoundException;
 5 import java.io.PrintWriter;
 6 
 7 public class Jiujiu {
 8 
 9     public static void fun() throws FileNotFoundException {
10         PrintWriter pw=new PrintWriter("d:/xyz.txt");
11         for(int i=1;i<=9;++i) {
12             for(int j=1;j<=i;++j) {
13                 pw.print(i+"*"+j+"="+(i*j)+"     ");
14             }
15             pw.println();
16         }
17         pw.close();
18         System.out.println("操作完成");
19     }
20     public static void main(String[] args) throws FileNotFoundException {
21         fun();
22     }
23 
24 }

 

posted @ 2020-12-20 01:46  丁帅帅dss  阅读(96)  评论(0)    收藏  举报