本文主要是介绍PAT 1059 Prime Factors [素数因子的判断] [因子个数的判断],希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1k1×p2k2×⋯×pmkm.
Input Specification:
Each input file contains one test case which gives a positive integer N in the range of long int.
Output Specification:
Factor N in the format N =
p1^
k1*
p2^
k2*
…*
pm^
km, where pi's are prime factors of N in increasing order, and the exponent ki is the number of pi -- hence when there is only one pi, ki is 1 and must NOT be printed out.
Sample Input:
97532468
Sample Output:
97532468=2^2*11*17*101*1291
---------
这篇关于PAT 1059 Prime Factors [素数因子的判断] [因子个数的判断]的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!