'commit'
This commit is contained in:
26
TangDou/LianXiTi50/4.cpp
Normal file
26
TangDou/LianXiTi50/4.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//<2F>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void divide(int x) {
|
||||
for (int i = 2; i * i <= x; i++) {
|
||||
int cnt = 0;
|
||||
while (x % i == 0) x /= i, cnt++;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ˻<D3B3>
|
||||
for (int j = 1; j <= cnt; j++) {
|
||||
cout << i;
|
||||
if (j < cnt) cout << "*";//<2F><>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*<2A><>
|
||||
}
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD>Ҫдһ<D0B4><D2BB>
|
||||
if (x > 1) cout << '*' << x << endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int x;
|
||||
cin >> x;
|
||||
divide(x);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user