public static void main(String[] args) {
int i,j;
long sum = 0;
for(i = 1; i <= 10; i++){
int t = 1;
for(j = 1; j <= i; j++){
t *= j;
}
sum += t;
}
System.out.println(sum);
}
结果为:4037913
public static void main(String[] args) {
int i,j;
long sum = 0;
for(i = 1; i <= 10; i++){
int t = 1;
for(j = 1; j <= i; j++){
t *= j;
}
sum += t;
}
System.out.println(sum);
}
结果为:4037913