swustoj完数0044

完数(0044)

Time limit(ms): 5000
Memory limit(kb): 65535
Submission: 4642
Accepted: 1465
Accepted
14级卓越班选拔A 15级卓越班选拔A 16级卓越班选拔A

一个数如果恰好等于它的因子之和,这个数就称为"完数"。 例如,6的因子为1、2、3,而6=1+2+3,因此6是"完数"。 编程序找出N之内的所有完数,并按下面格式输出其因子:

Description

N

Input

? its fastors are ? ? ?

Output
1
1000
Sample Input
1
2
3
6 its fastors are 1 2 3
28 its fastors are 1 2 4 7 14
496 its fastors are 1 2 4 8 16 31 62 124 248
发布了24 篇原创文章 · 获赞 6 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/Wutongyewan/article/details/79106126