P1009这样写不对吗,自己调试答案没问题,系统判罚50分,不知道错在哪儿,求大神请教、
#include <iostream>
#include <cstring>//头文件不解释
#include<cmath>
#include<iomanip>
#include<algorithm>
using namespace std;
int main() {
int n;
int sum = 0;
int take = 1;
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
take = take * j;
}
sum += take;
take = 1;
}
cout << sum;
}