遞歸函數計算一個數的階乘. unsigned long factorial(int n). {. // 基本情況:如果`n` 是0 或1. if (n < 1) {. return 1;. } // 使用遞歸關係.
確定! 回上一頁