1 * 2 * 3 * ... * n. 用Matlab 正統方法寫,應該是. prod(1:n). 而如果硬要用迴圈,for 迴圈寫法是. fac = 1; for k=2:n fac = fac*k; end. 而while 迴圈的寫法是.
確定! 回上一頁