|
Decomposition of the factors
|
|
11-09-2009, 05:38 AM
Post: #1
|
|||
|
|||
|
Decomposition of the factors
This is an interesting problem. The point is to extract factors of the number. When you multiplicate those factors, you need to get entered number "n".
Input From standard input, read integer "n". Output Output in the next lines all prime factors. Sample Input 493 Sample Output 17 29 Sample Input 12 Sample Output 2 2 3 So basically, you don't need to check for prime numbers, because if the number is divideable with 2 it will be the first number that is going to be written . . . I made fast and small solution, first TPW : Code: program factors;Code: # include <iostream>There's a fine line between genius and insanity. I have erased this line. Oscar Levant There's a fine line between an administrator and black hat hacker. I have erased this line. Dr DEBCOL |
|||
|
« Next Oldest | Next Newest »
|





