给你核心代码吧,这是判断两个数是否是亲密数对的函数:function main(a,b : longint) : boolean;vari,s1,s2 : longint;beginif (a = b) then
exit(false);s1 := 0;s2 := 0;for i := 1 to a-1 do
if (a mod i) = 0 then
inc(s1,i);for i := 1 to b-1 do
if (b mod i) = 0 then
inc(s2,i);if (s1 = b)and(s2 = a) then
exit(tru...
vari,n,m,t,tt:longint;beginread(n,m);tt:=0;t:=0;for i:=1 to n-1 doif n mod i=0 then t:=t+i;for i:=1 to m-1 doif m mod i=0 then tt:=tt+i;if (t=m)and(tt=n) th...
var a,b,tota,totb,i:longint;beginreadln(a,b);tota:=0;totb:=0;for i:=1 to trunc(sqrt(a)) dobeginif a mod i=0 then inc(tota,i);if a mod (a div i)=0 then inc(tota,a div i);if ...