求m、n的最大公约数 用流程图表示
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/04 18:52:53
![求m、n的最大公约数 用流程图表示](/uploads/image/z/2443576-40-6.jpg?t=%E6%B1%82m%E3%80%81n%E7%9A%84%E6%9C%80%E5%A4%A7%E5%85%AC%E7%BA%A6%E6%95%B0+%E7%94%A8%E6%B5%81%E7%A8%8B%E5%9B%BE%E8%A1%A8%E7%A4%BA)
求m、n的最大公约数 用流程图表示
求m、n的最大公约数 用流程图表示
求m、n的最大公约数 用流程图表示
function GetMaxYueShu(M,N:Integer):Integer;
begin
Result := 0;
for I:=Min(M,N)-1 downto 0 begin
if (I mod M=0)and(I mod N=0) then begin
Result := I;
Exit;
end
end;
end;