Greatest common divisor: Difference between revisions
Content added Content deleted
imported>Szymon-Michalak |
|||
Line 2,620: | Line 2,620: | ||
<syntaxhighlight lang="text"> |
<syntaxhighlight lang="text"> |
||
func gcd a b . |
|||
while b <> 0 |
while b <> 0 |
||
h = b |
h = b |
||
b = a mod b |
b = a mod b |
||
a = h |
a = h |
||
. |
. |
||
return a |
|||
. |
. |
||
print gcd 120 35 |
|||
print r |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||