Amicable pairs: Difference between revisions

Content added Content deleted
(Add SETL)
m (→‎{{header|Wren}}: Minor tidy)
Line 6,722: Line 6,722:
{{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 a = List.filled(20000, 0)
var a = List.filled(20000, 0)
Line 6,731: Line 6,731:
var m = a[n]
var m = a[n]
if (m > n && m < 20000 && n == a[m]) {
if (m > n && m < 20000 && n == a[m]) {
System.print(" %(Fmt.d(5, n)) and %(Fmt.d(5, m))")
Fmt.print(" $5d and $5d", n, m)
}
}
}</syntaxhighlight>
}</syntaxhighlight>