写的有点乱
import java.util.Scanner;
class HomeWork13
{
public static void main(String[] args)
{
System.out.println("请输入数字:");
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
int h =1;
System.out.print(i+"的阶乘"+i+"!"+" ");
for (int j=1;j<=i;j++)
{
h *= j;
System.out.print(j);
if (j<i)
{
System.out.print("*");
}
}
System.out.print("="+h);
}
} |