You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
478 B
27 lines
478 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
//分解质因数
|
|
const int N = 110;
|
|
int a[N];
|
|
|
|
int divide(int x) {
|
|
int cnt = 0;
|
|
for (int i = 2; i <= x / i; i++)
|
|
while (x % i == 0) {
|
|
a[++cnt] = i;
|
|
x /= i;
|
|
}
|
|
if (x > 1)a[++cnt] = x;
|
|
return cnt;
|
|
}
|
|
|
|
int main() {
|
|
int cnt = divide(8);
|
|
for (int i = 1; i <= cnt; i++) {
|
|
if (i > 1) printf("*");
|
|
cout << a[i];
|
|
}
|
|
return 0;
|
|
} |