1 条题解

  • 0
    @ 2025-4-12 21:47:19

    C++ :

    #include <bits/stdc++.h>
    #define LL long long
    using namespace std;
    
    void f(LL x) {
    	for (LL i = 2; i <= x / i; i ++) {
    		while (x % i == 0) {
    			cout << "    " << i << endl;
    			x /= i;
    		}
    	}
    	if (x > 1) cout << "    " << x << endl;
    	cout << endl;
    }
    
    int main() {
    	LL n;
    	while (cin >> n && n >= 0) {
    		f(n);
    	}
    
    	return 0;
    }
    
    
    • 1

    信息

    ID
    1675
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者