Advertisement
MeehoweCK

Untitled

Jul 2nd, 2021
877
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     cout << "Podaj liczbe naturalna: ";
  8.     int liczba;
  9.     cin >> liczba;
  10.  
  11.     cout << 1 << ' ';
  12.     for(int i = 2; i < liczba; ++i)
  13.         if(liczba % i == 0)
  14.             cout << i << ' ';
  15.     cout << liczba << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement