JAVA每日一题(1)
题目:写一个方法,用一个for循环打印九九乘法表 [ 本帖最后由 lampeter123 于 2010-6-21 09:17 编辑 ]
public class Test { public Test() { cfb(1); } public static void cfb(int j) { for(int i=1;i<=j;i++) { System.out.print(j+"*"+i+"="+j*i+"\t"); } if(j+1<=9) { System.out.println(); cfb(j+1); } } public static void main(String args[]) { Test test=new Test(); } }