赞
踩
/** * 输出九九乘法表 * @author ad * */ public class NineByNine { public static void main(String[] args) { NineByNine n = new NineByNine(); n.printNineByNine(); } //输出九九乘法表 public void printNineByNine() { //外层循环 for (int i = 1; i <= 9; i++) { //内层循环 for (int j = 1; j <= i; j++) { System.out.printf("%d * %d = %d\t", j, i, i*j); } System.out.println(); } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。