以下程序中使用了递推方式计算阶乘(n!=1×2⋯×nn!=1\times2\cdots\times n ),计算结果正确。

 int factorial(int n) {   int res = 1;   for (int i = 0; i < n; ++i) {      res *= i;   }   return res; }
填写答案