26 lines
262 B
C++
26 lines
262 B
C++
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int n,num=2;
|
||
|
cin >> n;
|
||
|
cout << n << "=";
|
||
|
while (n!=1)
|
||
|
{
|
||
|
if (n/num==1)
|
||
|
{
|
||
|
cout << num;
|
||
|
break;
|
||
|
}
|
||
|
if (n%num==0)
|
||
|
{
|
||
|
cout << num<<"*";
|
||
|
n /= num;
|
||
|
}else
|
||
|
{
|
||
|
num++;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|