#includemain() { int a, d, n, sum = 0; long b = 1; printf("Input n:"); scanf("%d", &n); for (a = 1; a <= n; a++) { for (d = 1; d <= a; d++) { b *= d; } sum += b; b = 1; } printf("1!+2!+…+%d! = %ldn", n, sum); }
欢迎分享,转载请注明来源:内存溢出
#includemain() { int a, d, n, sum = 0; long b = 1; printf("Input n:"); scanf("%d", &n); for (a = 1; a <= n; a++) { for (d = 1; d <= a; d++) { b *= d; } sum += b; b = 1; } printf("1!+2!+…+%d! = %ldn", n, sum); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)