Anonymous user
Stem-and-leaf plot: Difference between revisions
→{{header|Nim}}
Line 2,176:
multiplier: int
plot: TableRef[int, seq[int]]
proc `$`(s: seq[int]): string =
result = ""
for item in s:
result &= $item & " "
proc `$`(self: StemLeafPlot): string =
Line 2,220 ⟶ 2,225:
echo $taskPlot
echo "Test with Reals and Negative Zero Stem"
var negativePlot = StemLeafPlot()
negativePlot.init(1, negativeData)
Line 2,227 ⟶ 2,232:
{{out}}
<pre>Using the Task's Test Data
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Test with Reals and Negative Zero Stem
-2 |
-1 |
0 |
1 |
2 |
3 |
4 |
5 |
=={{header|OCaml}}==
|