public class ClassTest03 { public static void main(String[] args) { for(int i=1,j=1;j<=9;j++){ if(i<j){ i++; j=1; System.out.println(""); } else{ System.out.print(j+"*"+i+"="+i*j+" "); //排版 低于两位数时多占一个空格 if(i*j<10) System.out.print(" "); } } } }
一个for循环写出9*9乘法表
猜你喜欢
转载自www.cnblogs.com/chuijingjing/p/9431902.html
今日推荐
周排行