开发者

Integer to its prime factors [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetor开发者_如何学Goical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago.

hey i need to desing a program that inputs an integer and outputs the prime factors of the integer example 660 input n output is 2 2 3 5 11


Break the problem down. Firstly, you need a list of every prime number smaller than the square root of the input. You can obtain this list slowly through trial division, or quickly by using something like Eratosthenes' Sieve - implement that, and you're halfway there. Everything else should fall into place.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜