int sum2(int n)
{
int s=0;
for (int I=1; I<=n; I++) {
int p=1;
for (int j=1; j<=I; j++)
p*=j;
s+=p;
}
return s;
}
出自:国家开放大学数据结构复习题