Greatest common divisor: Difference between revisions
Content deleted Content added
Added Transact-SQL |
Not a robot (talk | contribs) Add Draco |
||
Line 1,269: | Line 1,269: | ||
=={{header|Delphi}}== |
=={{header|Delphi}}== |
||
See [[#Pascal / Delphi / Free Pascal]]. |
See [[#Pascal / Delphi / Free Pascal]]. |
||
=={{header|Draco}}== |
|||
<lang draco>proc nonrec gcd(word m, n) word: |
|||
word t; |
|||
while n ~= 0 do |
|||
t := m; |
|||
m := n; |
|||
n := t % n |
|||
od; |
|||
m |
|||
corp |
|||
proc nonrec show(word m, n) void: |
|||
writeln("gcd(", m, ", ", n, ") = ", gcd(m, n)) |
|||
corp |
|||
proc nonrec main() void: |
|||
show(18, 12); |
|||
show(1071, 1029); |
|||
show(3528, 3780) |
|||
corp</lang> |
|||
{{out}} |
|||
<pre>gcd(18, 12) = 6 |
|||
gcd(1071, 1029) = 21 |
|||
gcd(3528, 3780) = 252</pre> |
|||
=={{header|DWScript}}== |
=={{header|DWScript}}== |