Untitled

 avatar
unknown
c_cpp
a year ago
308 B
4
Indexable
#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;
}

Editor is loading...
Leave a Comment