#include <iostream>
using namespace std;
int main()
{
int input;
while (cin >> input) {
int i, a=1,b=0;
for (i = 2;i < (input + 1);i++) {
a = 0;
while (!(input%i)) {
input = input / i;
a++;
if (input%i) {
if (b == 0) {
if (a == 1) {
cout << i;
b++;
}
else {
cout << i << "^" << a;
b++;
}
}
else {
if (a == 1) {
cout << " * " << i;
b++;
}
else {
cout << " * " << i << "^" << a;
b++;
}
}
}
}
}
}
return 0;
}
如題
為什麼會多一串?