n!表示n的阶乘。
#include <stdio.h> int main() { int n; int i; double r=1,y = 0; for (i=1;i<=n;i++) { r*=i; y += r; } printf("%g",y); return 0; }