就是java实现九九乘法表啊!效果如下:
* 1 2 3 4 5 6 7 8 9
1 1
2 2 4
3 3 6 9
4 4 8 12 16
5 5 10 15 20 25
6 6 12 18 24 30 36
7 7 14 21 28 35 42 49
8 8 16 24 32 40 48 56 64
9 9 18 27 36 45 54 63 72 81 了解了吗?麻烦你咯,谢谢高手咯
代码如下:
public class qct {
public static void main(String[] args)
{
int i=0;
int j=0;
for(i=1;i<=9;i++)
{ for(j=i;j<=9;j++)
System.out.print(i+"*"+j+"="+i*j+"\t");
System.out.println();
}
}
}
扩展资料
import java.lang.*;
import java.util.Arrays;
public class ChengFB
{
public static void main(String[] args)
{
int[] Num=new int[10];
for(int i=1;i<10;i++)
{
Num[i]=i;
}
for(int m=9;m>0;m--)
{
for(int j=9;j>=m;j--)
{
int Result;
Result=Num[m]*Num[j];
System.out.print(Num[j]+"*"+Num[m]+"="+Result+" ");
}
System.out.println();
}
}
public int Multi(int x,int y)
{
int temp;
temp=x*y;
return temp;
}
}
谢谢你,不过我要的是
* 1 2 3 4 5 6 7 8 9
1 1
2 2 4
3 3 6 9
4 4 8 12 16
5 5 10 15 20 25
6 6 12 18 24 30 36
7 7 14 21 28 35 42 49
8 8 16 24 32 40 48 56 64
9 9 18 27 36 45 54 63 72 81 种的,还是谢谢了
package ch02;
public class TEST{
public static void main(String[] args) {
for (int i = 1; i <=9; i++) {
System.out.print(i+" ");
for (int j = 1; j <= i; j++) {
System.out.print((i*j)+" ");
}System.out.println();
}
}
}
测试结果
1 1
2 2 4
3 3 6 9
4 4 8 12 16
5 5 10 15 20 25
6 6 12 18 24 30 36
7 7 14 21 28 35 42 49
8 8 16 24 32 40 48 56 64
9 9 18 27 36 45 54 63 72 81