#include<stdio.h> int main() { int n, t, k, s = 0; printf("input n\n"); scanf("%d", &n); k = 1; t = 1; while (k <= n) { t *= k; s += t; k++; } printf("s=%d\n \n", s); return 0; }