题解 | 计算一个数的阶乘
#include <iostream> using namespace std; int main() { int n; cin >> n; long long factorial = 1; long long fun(int); // write your code here...... factorial=fun(n); cout << factorial << endl; return 0; } long long fun(int k ) {if (k==1) return 1; else return (k*fun(k-1)); }