Abundant odd numbers: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
Line 6,691:
{{libheader|Wren-fmt}}
{{libheader|Wren-math}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
import "./math" for Int, Nums
var sumStr = Fn.new { |divs| divs.reduce("") { |acc, div| acc + "%(div) + " }[0...-3] }
Line 6,707:
var s = sumStr.call(divs)
if (!printOne) {
SystemFmt.print("%(Fmt$2d. $5d < $s = $d(2", count)). %(Fmt.d(5, n)), < %(s), = %(tot)")
} else {
SystemFmt.print("%(n)$d < %($s) = %(tot)$d", n, s, tot)
}
}
9,482

edits