SET TALK OFFCLEARinput '请输入一个正整数:' to na=1FOR i=1 TO na=a*iNEXT i? ALLTRIM(STR(n))+'的阶乘='+ALLTRIM(STR(a))SET TALK ONRETURN
运行结果:
请输入一个正整数:(假设输入3)
3的阶乘=6