Special pythagorean triplet: Difference between revisions
Content added Content deleted
m (a < b < c) |
(timing) |
||
Line 103: | Line 103: | ||
1-element Vector{Tuple{Int64, Int64, Int64}}: |
1-element Vector{Tuple{Int64, Int64, Int64}}: |
||
(200, 375, 425) |
(200, 375, 425) |
||
</pre> |
|||
or, with attention to timing: |
|||
<pre> |
|||
julia> @time for a in 1:1000 |
|||
for b in a+1:1000 |
|||
c = 1000 - a - b; a^2 + b^2 == c^2 && @show a, b, c |
|||
end |
|||
end |
|||
(a, b, c) = (200, 375, 425) |
|||
0.001073 seconds (20 allocations: 752 bytes) |
|||
</pre> |
</pre> |
||