提交时间:2026-03-06 20:30:30
运行 ID: 85212
#include<bits/stdc++.h> using namespace std; int fact(int x) { int tot = 1; for(int i = 1; i <= x; i++){ tot *= i; } return tot; } int main() { int n; cin>>n; int cnt = 0; for(int i = 1; i <= n; i++){ cnt += fact(i); } cout<<cnt; }