Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Stem-and-leaf-plot/Icon/stem-and-leaf-plot.icon
Normal file
12
Task/Stem-and-leaf-plot/Icon/stem-and-leaf-plot.icon
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
procedure main(A)
|
||||
prune := integer(\A[1]) | 10 # Boundary between leaf and stem
|
||||
every put(data := [], integer(!&input))
|
||||
writes(right(oldStem := 0,5)," |")
|
||||
every item := !sort(data) do {
|
||||
leaf := item % prune
|
||||
stem := item / prune
|
||||
while (oldStem < stem) do writes("\n",right(oldStem +:= 1, 5)," |")
|
||||
writes(" ",right(leaf,*prune-1,"0"))
|
||||
}
|
||||
write()
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue