#include
#define N 50
void main()
{
int i=1,t=1,s=0;
while(i<=N)
{
t=t*i;
s=s+t;
i++;
}
printf("s=%d\n",s);
}
注意:while循环结构
也不知道你要求用什么语言实现
我就用VBS来实现吧
function cheng(n)
dim i,s
s = 1
for i = 1 to n
s = s * 1
next
cheng = s
end function
function sumc(n)
dim i,s
s = 0
for i = 1 to n
s = s + cheng(n)
next
sumc = s
end function
调用的时候只需要调用sumc(n)即可。
本题的知识点:主要就是循环了,再就是函数调用;阶乘的概念