Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
117205 | 郝王骏程 | 阶乘的和 | C++ | Accepted | 1 MS | 276 KB | 478 | 2025-04-14 20:27:10 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int z(int a){ int sum=1; for(int i=1;i<=a;i++){ sum*=i; } return sum; } int main(){ int n,s=0; cin>>n; for(int j=1;j<=n;j++){ s=s+z(j); } cout<<s; return 0; }