Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Multiplication-tables/F-Sharp/multiplication-tables.fs
Normal file
19
Task/Multiplication-tables/F-Sharp/multiplication-tables.fs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
open System
|
||||
|
||||
let multTable () =
|
||||
Console.Write (" X".PadRight (4))
|
||||
for i = 1 to 12 do Console.Write ((i.ToString "####").PadLeft 4)
|
||||
Console.Write "\n ___"
|
||||
for i = 1 to 12 do Console.Write " ___"
|
||||
Console.WriteLine ()
|
||||
for row = 1 to 12 do
|
||||
Console.Write (row.ToString("###").PadLeft(3).PadRight(4))
|
||||
for col = 1 to 12 do
|
||||
if row <= col then Console.Write ((row * col).ToString("###").PadLeft(4))
|
||||
else
|
||||
Console.Write ("".PadLeft 4)
|
||||
Console.WriteLine ()
|
||||
Console.WriteLine ()
|
||||
Console.ReadKey () |> ignore
|
||||
|
||||
multTable ()
|
||||
Loading…
Add table
Add a link
Reference in a new issue