int suml(int n)
{
int p=1,s=0;
for (int i=1; i<=n; i++) {
p*=i;
s+=p;
}
return s;
}

出自:国家开放大学数据结构复习题