Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
102453 | 王思颜 | n的阶乘 | C++ | Accepted | 1 MS | 276 KB | 238 | 2024-12-21 16:41:46 |
#include<bits/stdc++.h> using namespace std; int mp(int a,int n,int x){ if (n <= a){ x = x * n; n++; mp(a,n,x); } else{ return x; } } int main() { int a,n = 1,x = 1; cin>>a; cout<<mp(a,n,x); return 0; }