Advertisement
Josif_tepe

Untitled

Feb 3rd, 2023
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. #include <cmath>
  5. using namespace std;
  6.  
  7.  
  8. int main() {
  9.     int number;
  10.     cin >> number;
  11.    
  12.     for(int i = 1; i <= sqrt(number); i++) {
  13.         if(number % i == 0) {
  14.             cout << i << " ";
  15.             if(i != number / i) {
  16.                 cout << number / i << " " ;
  17.             }
  18.         }
  19.     }
  20.    
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement