#include<iostream>
#include<map>
typedef long long LL;
using namespace std;
int main(){
map<LL, int> mp;
LL n, t;
int i = 1;
scanf("%lld", &n);
t = n;
for(int i = 2; i * i <= t; i++){
if(t % i == 0){
while(t % i == 0){
mp[i]++;
t /= i;
}
}
}
if(t > 1) mp[t]++;
printf("%lld=", n);
if(mp.size() != 0){
for(map<LL, int>::iterator it = mp.begin(); it != mp.end(); it++, i++){
if(it -> second == 1) printf("%lld", it -> first);
else printf("%lld^%lld", it -> first, it -> second);
if(i != mp.size()) printf("*");
}
}
else printf("%lld", n);
return 0;
}
1059 Prime Factors
最新推荐文章于 2024-11-04 21:39:11 发布