Untitled

mail@pastecode.io avatar
unknown
c_cpp
23 days ago
308 B
2
Indexable
Never
#include <iostream>
using namespace std;

int main() {
    long long x;
    cin >> x;
    
    for(long long i = 1; i * i <= x; i += 1) {
        if(x % i == 0) {
            cout << i << " " ;
            if(i != x / i) {
                cout << x / i << " ";
            }
        }
    }
    return 0;
}

Leave a Comment