Определить наибольший общий делитель трех чисел — Pascal(Паскаль)

var a, b, c, i : integer;
function delitel (a, b, c: integer) : integer;
begin
delitel := 0;
  for i := 1 to a do begin
  if (a mod i = 0) and (b mod i = 0) and (c mod i = 0) then delitel := i;
  end;
end;
begin
read (a, b, c);
if delitel (a, b, c) = 0 then writeln ('No delitel')
else write ('Delitel: ', delitel (a, b, c));
readln; readln;
end.

Leave a Comment

83 − 77 =