我是 F# 的新手,但是当我使用详细语法将 for 循环放入另一个循环时,它不会编译:
#light "off"
let Multiple9x9 () =
for i in 1 .. 9 do
printf "\n";
for j in 1 .. 9 do
let k = i * j;
printf "%d x %d = %2d " i j k ;
done;;
done;;
Multiple9x9 ();;
printf "\n" ;;
我知道它可以与#light“on”一起使用:
let Multiple9x9 () =
for i in 1 .. 9 do
printf "\n"
for j in 1 .. 9 do
let k = i * j
printf "%d x %d = %2d " i j k
Multiple9x9 ()
printf "\n"