JAVA每日一题(1)
题目:写一个方法,用一个for循环打印九九乘法表 [ 本帖最后由 lampeter123 于 2010-6-21 09:17 编辑 ]
2010-06-21 08:29
程序代码: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();
}
}
2010-06-21 11:03
2010-06-21 11:14
2010-06-21 12:14
2010-06-21 18:16
2010-06-21 19:23
。。。。。。。。。。
2010-06-21 21:55

2010-06-21 22:56
2010-06-22 00:20
2010-06-22 02:05