题解 | #计算一个数的阶乘#
计算一个数的阶乘
https://www.nowcoder.com/practice/b0423a89826c4d68a3e8b9832a6a1f49
#include <iostream> using namespace std; int main() { long long int function(int x); int n; cin >> n; cout<<function(n); } long long int function(int x) { if(x==1) return 1; else return x*function(x-1);//x!=x*(x-1)!; }