Помогите задание по Delphi 7 )) Подробно распишите код) пожалуйста))
Answers & Comments
ayshatsh VAR N1,N2,M,i:LongInt; BEGIN Write('N1= '); ReadLn(N1); Write('N2= '); ReadLn(N2); If N1>N2 then M:=N1 else M:=N2; i:=M-1; Repeat Inc(i); Until ((i mod N1)=0) and ((i mod N2)=0); Writeln('Result is ',i); Readln END.
Answers & Comments
VAR
N1,N2,M,i:LongInt;
BEGIN Write('N1= ');
ReadLn(N1);
Write('N2= ');
ReadLn(N2);
If N1>N2 then M:=N1 else M:=N2;
i:=M-1;
Repeat Inc(i);
Until ((i mod N1)=0) and ((i mod N2)=0);
Writeln('Result is ',i);
Readln
END.