var a,b,i,t,s: word;
begin
repeat
writeln('Nhap A,B vao: (cach nhau boi dau Enter)');
readln(a);
read(b);
writeln('Nhap lai gia tri A,B: ');
until (a>=1) and (b>=1) and (a<=10000) and (b<10000);
s:=a+b;
t:=a*b;
if s<t then i:=s else i:=t;
while (s mod i <> 0) or (t mod i <> 0) do i:=i-1;
writeln('UCLN cua A+B va AB: ',i);
writeln('So du khi chia AB cho A+B: ', t mod s);
end.
Đúng 1
Bình luận (0)