Pagini recente » Cod sursa (job #478750) | Cod sursa (job #1951152) | Cod sursa (job #1883818) | Cod sursa (job #2106953) | Cod sursa (job #1453705)
Program p1; uses crt;
var a,b,c,max,min,v,i:integer; fo,fi:text; u:boolean;
begin clrscr;
assign(fi,'p1.in'); reset(fi);
assign(fo,'p1.out'); rewrite(fo);
read(fi,a,b);
if a>b then max:=a else max:=b;
if b<a then min:=b else min:=a;
for i:=max downto 1 do begin
if min>max then begin v:=max; max:=min; min:=v; end;
max:=max-min; if max=min then c:=max;
end;
if c=1 then c:=0;
writeln(fo,c); close(fo)
end.