var
a1,b1,i,j:longint;
begin
for i:=1 to 1000 do begin
a1:=0;
for j:=1 to i-1 do
if i mod j = 0 then
a1:=a1+j;
b1:=0;
for j:=1 to a1-1 do
if a1 mod j = 0 then
b1:=b1+j;
if (b1 = i) and (i <> a1) then
writeln(i,' ',a1);
if (a1 > 1000) or (b1 > 1000) then
break;
end;
end.
在http://218.4.165.132/oj/ShowProblem?problemid=d072测了AC