P1075 [NOIP2012 普及组] 质因数分解
#include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
for (int j = 2;; j++) {
if (x % j==0) {
cout << x/j << endl;
return 0;
}
}
return 0;
}
挺巧妙的
P1075 [NOIP2012 普及组] 质因数分解
#include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
for (int j = 2;; j++) {
if (x % j==0) {
cout << x/j << endl;
return 0;
}
}
return 0;
}
挺巧妙的