program nok;
var a, b, i: integer;
Begin
readln(a);
readln(b);
for i:=1 to a*b+1 do
if (i mod a = 0) and (i mod b = 0) then begin
write(i);
break;
end;
End.
30 | 2 ✓ 60 | 2 ✓
15 | 3. ✓ 30 | 2
5 | 5.✓ 15 | 3. ✓
1 |. 5 | 5✓
1 |
(НОК 30;60) 30 х 2= 60
program nok;
var a, b, i: integer;
Begin
readln(a);
readln(b);
for i:=1 to a*b+1 do
if (i mod a = 0) and (i mod b = 0) then begin
write(i);
break;
end;
End.
30 | 2 ✓ 60 | 2 ✓
15 | 3. ✓ 30 | 2
5 | 5.✓ 15 | 3. ✓
1 |. 5 | 5✓
1 |
(НОК 30;60) 30 х 2= 60