Factors of an integer: Difference between revisions
Content added Content deleted
m (Reordering BASIC dialects) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 7,047: | Line 7,047: | ||
{{libheader|Wren-fmt}} |
{{libheader|Wren-fmt}} |
||
{{libheader|Wren-math}} |
{{libheader|Wren-math}} |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">import "./fmt" for Fmt |
||
import "/math" for Int |
import "./math" for Int |
||
var a = [11, 21, 32, 45, 67, 96, 159, 723, 1024, 5673, 12345, 32767, 123459, 999997] |
var a = [11, 21, 32, 45, 67, 96, 159, 723, 1024, 5673, 12345, 32767, 123459, 999997] |
||
System.print("The factors of the following numbers are:") |
System.print("The factors of the following numbers are:") |
||
for (e in a) |
for (e in a) Fmt.print("$6d => $n", e, Int.divisors(e))</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |