BỘI CHUNG NHỎ NHẤT SỬ DỤNG CHƯƠNG TRÌNH CON



program bai2;
var  x,y :integer ;
function BCNN(a,b :integer ) : integer;
var  a1,b1 :integer;
begin
a1:=a;b1:=b;
While a<> b do if a>b then a:=a-b else b:=b-a;
BCNN:= (a1*b1) div a;
end;
begin
Write('nhap hai so x,y = ');readln(x,y);
Write('BCNN la ',BCNN(x,y));
readln;
end.


2 nhận xét: