Program bai1;
uses crt;
var tu,mau: integer;
a,b,r,ucln : integer;
begin
clrscr;
write('nhap tu ='); readln(tu);
write('nhap mau ='); readln(mau);
if mau = 0 then writeln('khong phai la phan so ')
else
begin
write(tu ,' / ' , mau);
a:=tu;
b:=mau;
r:=a mod b;
while r <> 0 do
begin
a:=b;
b:=r;
r:=a mod b ;
end;
ucln:=b;
tu:=tu div ucln;
mau:= mau div ucln;
if mau <> 1 then
write('=' , tu , '/' ,mau)
else write(tu);
end;
readln;
end.