Pythagorean triples: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Changed to Wren S/H) |
(→Lazy Functional Version: Use writefln) |
||
Line 1,259: | Line 1,259: | ||
auto xs = triples(100); |
auto xs = triples(100); |
||
writefln("\nUp to %d there are %d triples, %d are primitive.", N, xs.count, |
|||
xs.filter!q{ a[0] }.count |
xs.filter!q{ a[0] }.count); |
||
} |
|||
</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
<pre> |
|||
Up to 100 there are 17 triples, 7 are primitive. |
|||
</pre> |
|||
===Shorter Version=== |
===Shorter Version=== |