Advertisement
Josif_tepe

Untitled

Feb 26th, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n; // brojot na cobblestone
  9.     for(int i = 1; i <= n; i += 1) {
  10.         if(n % i == 0) { // ostatok pri delenje na n so i treba da vrati 0
  11.             cout << i << " ";
  12.         }
  13.     }
  14.     return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement