Pythagorean triples: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
Line 1,259: Line 1,259:


auto xs = triples(100);
auto xs = triples(100);
writeln("Up to 100 there are ", xs.count, " triples, ",
writefln("\nUp to %d there are %d triples, %d are primitive.", N, xs.count,
xs.filter!q{ a[0] }.count, " are primitive.");
xs.filter!q{ a[0] }.count);
}
}</syntaxhighlight>
</syntaxhighlight>

{{out}}
{{out}}
<pre>
<pre>Up to 100 there are 17 triples, 7 are primitive.</pre>
Up to 100 there are 17 triples, 7 are primitive.
</pre>


===Shorter Version===
===Shorter Version===