解题思路:
水题!!!
代码如下:
#include <iostream>
using namespace std;
const int N = 100010;
int p[N];
int k;
bool vis[N];void init()
{for (int i = 2;i<=N-1;i++){if (!vis[i])p[++k] = i;for (int j = 2*i;j<=N-1;j+=i)vis[j] = true;}
}int main()
{init();int n;cin>>n;int j = 1;while(n!=1 && j <=k){if (n%p[j]==0){cout<<p[j];n = n/p[j];}else{j++;continue;}if (n!=1) cout<<"*";}return 0;
}