home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / pascal-.zip / pascal- / tests / conformance / gcd < prev    next >
Encoding:
Text File  |  1992-11-29  |  188 b   |  14 lines

  1. {Greatest common divisor}
  2. program GCD;
  3. var
  4.   x,y: integer;
  5. begin
  6. read(x);
  7. while x<>0 do
  8.   begin read(y);
  9.   while x<>y do if x>y then x:=x-y else y:=y-x;
  10.   write(x);
  11.   read(x);
  12.   end;
  13. end.
  14.