Abundant odd numbers: Difference between revisions

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