Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program A;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- var
- m, n, i: integer;
- begin
- readln (n, m);
- i := 1;
- if (n = 0) or (m = 0) then begin
- writeln (0);
- exit;
- end;
- while (n <> m) do begin
- if (n > m) then
- n := n - m
- else
- m := m - n;
- inc (i);
- end;
- writeln (i);
- readln;
- readln;
- end.
RAW Paste Data