for n=1 to 1000s=0for m=1 to n/2 if n%m=0 s=s+m endifendforif s=n ?n,"是完数,其因子有“, for m=1 to n/2 if n%m=0 ??m endif endfor endifendfor