HBC25046SimpleMathProblem,思维[USACO 2007 Jan L]Factors题解

淫家是湿人 算法基础篇 74 0
全网最全C++题库,助您快速提升编程技能!题库丰富多样,涵盖各个领域,让您在练习中不断成长!
Integers greater than 1 have more than one factor: a factor is a number that divides evenly into an integer. The number 6 has factors of 1, 2, 3, and 6. Ignoring the number 6 itself, it's interesting to note that 1+2+3=6, which makes 6 a "perfect number". The number 14 has factors 1, 2, 7, and 14. Their sum is 10.In the ongoing quest for perfect numbers, write a program that reads a single integer (1

Integers greater than 1 have more than one factor: a factor is a number that divides evenly into an integer. The number 6 has factors of 1, 2, 3, and 6. Ignoring the number 6 itself, it's interesting to note that 1+2+3=6, which makes 6 a "perfect number". The number 14 has factors 1, 2, 7, and 14. Their sum (ignoring 14 itself) is 10. In the ongoing quest for perfect numbers, write a program that reads a single integer (1 <= N <= 10,000,000) and prints the sum of its factors (not including the number itself).

HBC25046SimpleMathProblem,思维[USACO 2007 Jan L]Factors题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC25046SimpleMathProblem 思维[USACO 2007 Jan L]Factors题解