Coprimes: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 624: | Line 624: | ||
</pre> |
</pre> |
||
=={{header|EasyLang}}== |
|||
<syntaxhighlight> |
|||
func gcd a b . |
|||
while b <> 0 |
|||
h = b |
|||
b = a mod b |
|||
a = h |
|||
. |
|||
return a |
|||
. |
|||
proc test p[] . . |
|||
if gcd p[1] p[2] = 1 |
|||
print p[] |
|||
. |
|||
. |
|||
pairs[][] = [ [ 21 15 ] [ 17 23 ] [ 36 12 ] [ 18 29 ] [ 60 15 ] ] |
|||
for i to len pairs[][] |
|||
test pairs[i][] |
|||
. |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
func gcd a b . |
|||
while b <> 0 |
|||
h = b |
|||
b = a mod b |
|||
a = h |
|||
. |
|||
return a |
|||
. |
|||
proc test p[] . . |
|||
if gcd p[1] p[2] = 1 |
|||
print p[] |
|||
. |
|||
. |
|||
pairs[][] = [ [ 21 15 ] [ 17 23 ] [ 36 12 ] [ 18 29 ] [ 60 15 ] ] |
|||
for i to len pairs[][] |
|||
test pairs[i][] |
|||
. |
|||
</pre> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
Line 636: | Line 677: | ||
18 and 29 are coprime |
18 and 29 are coprime |
||
</pre> |
</pre> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
{{works with|Factor|0.98}} |
{{works with|Factor|0.98}} |