一個數(shù)如果恰好等于不包含它本身所有因子之和,這個數(shù)就稱為"完數(shù)"。 例如,6的因子為1、2、3,而6=1+2+3,因此6是"完數(shù)"。 編程序找出N之內(nèi)的所有完數(shù),并按下面格式輸出其因子
N
? its factors are ? ? ?
1000
6 its factors are 1 2 3 28 its factors are 1 2 4 7 14 496 its factors are 1 2 4 8 16 31 62 124 248