求整数唯一分解定理的算法!
Description
For a given integer, "Prime Factorization" is finding which prime numbers you need to multiply together to get the original number, also called prime decomposition.
Given a positive integer n>=2, the prime factorization is written
n = p1(a1)p2(a2)...pk(ak)
where the pis are the k prime factors, each of order ai.
Write a program to factor a given integer n.
Input
One integer, n. (2<=n<=231-1).
Output
Output the prime factorization of n as follows:
n=p1(a1)p2(a2)...pk(ak)
Where p1<p2<...<pk, and ai denotes the exponent of pi.
For example, for n = 1500 = 22*3*53, the output should be:
1500=2(2)3(1)5(3)
Sample Input #1
2
Sample Output #1
2=2(1)
Sample Input #2
15
Sample Output #2
15=3(1)5(1)
Sample Input #3
1001
Sample Output #3
1001=7(1)11(1)13(1)