编辑代码

#include <stdio.h>
int main (void)
{
    int i =1,s = 1,sum=0;
    do 
        {
            s*=i;
            sum+=s;
            ++i;
        }
    while (i<=5);
    printf("1到5的阶乘为:%d\n",sum);
    return 0;
}