class NMulti
{
public static void main(String[] args)
{
//定义乘积sum
int sum=1;
for (int x=1;x<=10 ;x++ )
{
//先打印1
System.out.print("1");
sum*=x;
//内循环列
for (int y=2;y<=x ;y++ )
{
//连续打印打印*y
System.out.print("*"+y);
}
System.out.print("="+sum);
System.out.println();
}
}
}
|
|