Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56141 | 许兴平 | 求阶乘的和 | C++ | Accepted | 0 MS | 240 KB | 234 | 2024-11-09 14:34:48 |
#include<bits/stdc++.h> using namespace std; int main(){ int k,result=0; cin>>k; for(int i=1;i<=k;i++){ int jiechengofi=1; for(int k=1;k<=i;k++) jiechengofi*=k; result+=jiechengofi; } cout<<result; return 0; }