Advertisement
Josif_tepe

Untitled

Mar 16th, 2024
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int n;
  6.     cin >> n;
  7.  
  8.     int koren = sqrt(n);
  9.    
  10.     for(int i = 1; i <= koren; i++) {
  11.         if(n % i == 0) {
  12.             cout << i << " ";
  13.  
  14.             if(i != n / i) {
  15.                 cout << n / i << endl;
  16.             }
  17.         }
  18.     }
  19.     return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement