uses crt;
var e,f,i,a,b,c,d: byte;
begin
clrscr;
write('Tu so = '); readln(e);
write('Mau so = '); readln(f);
a:=e;
b:=f;
writeln('Phan so ban dau: ',e,'/',f);
while E <> F do
if E > F then E:=E-F
else F:=F-E;
If e <> 1 then
begin
a:=a div e;
b:=b div e;
write('Phan so toi gian: ',a,'/',b);
end
else write('Phan so da toi gian, ',a,'/',b);
readln
end.
uses crt;
var a,b,min,i,ucln:integer;
begin
clrscr;
write('Nhap a='); readln(a);
repeat
write('Nhap b='); readln(b);
until b<>0;
min:=a;
if min>b then min:=b;
ucln:=1;
for i:=1 to min do
if (a mod i=0) and (b mod i=0) then
begin
if ucln<i then ucln:=i;
end;
writeln(a,'/',b,'=',a div ucln,'/',b div ucln);
readln;
end.