Advertisement
MeehoweCK

Untitled

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