import ner;
/**
* 求正整数阶乘和
*/
public class $sum {
@SuppressWarnings("resource")
public static void main(String[] args) {
//控制台输入阶乘的最大值:
Scanner sc=new Scanner();
tln("Input Number:");
long input=Int();
//定义变量:
long temp=1;
long sum=0;
String newsum = "";
//循环主体内容
for(int i=0;i
for(int k=1;k<=i+1;k++)
tln((i+1)+"!="+temp+" ");//打印1-n的各自的阶乘数
sum=sum+temp;//求和
//求各自阶乘的String
if(i+1==input){
newsum=newsum+(i+1)+"!";
}else{
newsum=newsum+(i+1)+"!+";
}
//重置临时变量temp
temp=1;
}
tln("");//换行
tln(newsum+"="+sum);//输出结果
}
}