Type: Default 1000ms 256MiB

C++-循环while-寻找完美数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

Description

题目:输入一个数字n和m,判断从n开始到m,一共有几个完全数,并进行输出。 例如: 输入7; 输出:1+2+3=6; 证明从2到7一共有一个完全数是6; 完全数(Perfect number),又称完美数或完备数,是一些特殊的自然数。它所有的真因子(即除了自身以外的约数)的和(即因子函数),恰好等于它本身。 所以这里我们需要找出这个数字的所有约数,去除掉本身之后进行加和,之后进行比较。

Format

Input

Output

Samples

1 10000
6 28 496 8128

Limitation

1s, 1024KiB for each test case.

C++基础知识02(循环-for和while及嵌套)

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
18
Start at
2024-5-5 0:00
End at
2024-5-25 20:00
Duration
500 hour(s)
Host
Partic.
28