Anonymous user
Perfect numbers: Difference between revisions
Updated second D entry
(Updated second D entry) |
|||
Line 490:
<lang d>import std.stdio, std.algorithm, std.range;
bool isPerfect(in
in {
return n == iota(1, n - 1).reduce!((s, i) => n % i ? s : s + i);▼
assert(n > 0);
} body {
}
void main() {
iota(
}</lang>
|