PRINT INPUT PROMPT "階乗をとります。自然数は? ":n PRINT PRINT FACT(n) PRINT END EXTERNAL FUNCTION FACT(n) IF n=0 THEN LET FACT=1 ELSE LET FACT=n*FACT(n-1) END IF END FUNCTION