题解 | #阶乘计算#
阶乘计算
https://ac.nowcoder.com/acm/problem/22205
#include<bits/stdc++.h>
using namespace std;
int n,s;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
int m=1;
for(int j=1;j<=i;j++){
m*=j;
}
s+=m;
}
cout<<s;
return 0;
}