import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out .print(a);
jiecheng(a,1);
}
static void jiecheng (int i,int sum) {
if(i==1) {
System.out .print("="+sum);
return;
}
sum=sum*i;
int j =i-1;
System.out .print("*"+j);
jiecheng(i-1,sum);
}
}
输出示范
10
10*9*8*7*6*5*4*3*2*1=3628800
网友评论