Prime Factorization
EasyRead a single positive integer from stdin and print its prime factorization.
Input format: one line holding a single integer n, where n > 1.
Output format: one line listing every prime factor in ascending order, joined by * (a star with one space on each side).
For example, 360 factors into 2 * 2 * 2 * 3 * 3 * 5.
Constraints
- Input is a single integer greater than 1
- Print the prime factors in ascending order
- Join the factors with a star, with one space on each side
Examples
| Input | Expected Output |
|---|---|
| 360 | 2 * 2 * 2 * 3 * 3 * 5 |
| 32 | 2 * 2 * 2 * 2 * 2 |
| 14 | 2 * 7 |
Write your solution and click “Run tests” to see results here.