Advertisement
MeehoweCK

Untitled

Aug 20th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     unsigned liczba;
  8.     cout << "Podaj liczbe naturalna: ";
  9.     cin >> liczba;
  10.     unsigned dzielnik = 1;
  11.  
  12.     cout << "Naturalne dzielniki liczby " << liczba << ":\n";
  13.  
  14.     while(dzielnik <= liczba)
  15.     {
  16.         if(liczba % dzielnik == 0)
  17.             cout << dzielnik << '\t';
  18.         ++dzielnik;
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement