最后结果是result
int result=1;
int num=1;
for(int i=2;i<11;i++){
num*=i;
result+=num;
}
完整的
public class Test {
public static void main(String[] args) {
int sum = 0;
int fac = 1;
for(int i = 1; i <= 10; i++){
fac *= i;
sum += fac;
}
System.out.println("1! + 2!+..10! = " + sum);
}
}