#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long a = 0; long long p = 2; if (n == 1) cout << 1 << endl; while (n > 1) { long long cut = 0; while (n % p == 0) { n /= p; cut++; } if (cut > 0) { if (a) cout << "*"; cout << p; if (cut > 1) cout << "^" << cut; a = 1; } p++; } cout << endl; }
共 2 条回复
???
循环次数太多了