comparison lab3/gcdfun.p @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab3/gcdfun.p *)
2
3 proc gcd(x, y);
4 begin
5 while x <> y do
6 if x > y then
7 x := x - y
8 else
9 y := y - x
10 end
11 end;
12 return x
13 end;
14
15 begin
16 print gcd(3*37, 7*37); newline
17 end.
18
19 (*<<
20 37
21 >>*)