点击运行
var num:number = 5; var factorial:number = 1; while(num >=1) { factorial = factorial * num; num--; } console.log("5 的阶乘为:"+factorial);
运行结果 :
正在执行...