Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
33475 | chenyanda | 求阶乘的和 | C++ | Accepted | 0 MS | 248 KB | 211 | 2023-12-09 16:08:04 |
#include<iostream> using namespace std; int main() { long long int n,s=0,t=1; cin>>n; for(int i=1;i<=n;i++) { t*=i; s+=t; } cout<<s; return 0; }