Problem : 完数

Problem : 完数

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 260  Solved: 169
[Submit] [Status] [Web Board] [Creator:]

Description

一个数如果恰好等于它的因子之和,就被成为完数。
例如6的因子为1,2,3,而6=1+2+3,所以6是一个完数。
编程找出1-1000之间的所有完数,并按照从小到大的顺序输出。

Output

6 is a wanshu:1,2,3,
28 is a wanshu:1,2,4,7,14,
496 is a wanshu:1,2,4,8,16,31,62,124,248,

Sample Output

6 is a wanshu:1,2,3,
28 is a wanshu:1,2,4,7,14,
496 is a wanshu:1,2,4,8,16,31,62,124,248,

[Submit][Status]