题解 | #质数因子#
质数因子
https://www.nowcoder.com/practice/196534628ca6490ebce2e336b47b3607
#include <iostream> #include <cmath> using namespace std; int main() { long n; cin >> n; for (int i = 2; i <= sqrt(n); ++i){ while (n % i == 0){ cout << i << ' '; n /= i; } } if (n > 1){ cout << n << endl; } return 0; }#23届找工作求助阵地##零基础学习C++##C++#