要求
将九九乘法口诀表打印下来
实施
package com.sy.pm;
public class Test15 {
public static void main(String[] args) {
for (int i = 1; i < 10; i++) {
for (int a = 1; a <= i; a++) {
int sum = i * a;
String count ;
if (a == i){
count = i + "×" + a + " = " + sum ;
System.out.println(count);
break;
}else{
count = i + "×" + a + " = " + sum +" ";
System.out.print(count);
}
}
}
}
}
版权属于:牧瀬くりす
本文链接:https://hcyacg.com/tutorial/Java-5.html
本站文章采用知识共享署名4.0 国际许可协议进行许可,允许非商业转载,但必须注明出处!