文件目录

#include <iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    string ans = "";
    for (int i = 2; i <= n; i++)
    {
        int j = 1;
        if (n % i == 0)
        {
            ans += to_string(i);
            n /= i;
        }
        else
            continue;
        while (n % i == 0)
        {
            j++;
            n /= i;
        }
        if (j != 1)
            ans += "^" + to_string(j) + "*";
        else
            ans += "*";
    }
    ans.resize(ans.size() - 1);
    cout << ans;
    return 0;
}