Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // // returnere multipiaktionstabel fra 1 til n, vha. to for loops.
- let loopMulTable n =
- let mutable a = ""
- for x = 0 to n do
- a <- a + (sprintf "\n")
- a <- a + (sprintf " %4d " x)
- for y = 1 to 10 do
- if (x = 0) then
- a <- a + (sprintf " %4d " y)
- else
- a <- a + (sprintf " %4d " (x * y))
- a
- // Eksempel
- printfn "%s" (loopMulTable 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement