view lab3/gcd.p @ 0:5dd13b8deb54 tip basis

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 16 Aug 2018 13:59:09 +0100
parents
children
line wrap: on
line source
(* lab3/gcd.p *)

var x, y;

begin
  x := 3 * 37; y := 5 * 37;
  while x <> y do
    if x > y then
      x := x - y
    else
      y := y - x
    end
  end;
  print x; newline
end.

(*<<
 37
>>*)