Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned n;
- cout << "Podaj liczbe naturalna: ";
- cin >> n;
- cout << "Naturalne dzielniki liczby " << n << ":\n";
- cout << 1 << '\t';
- for(unsigned dzielnik = 2; dzielnik < n; ++dzielnik)
- {
- if(n % dzielnik == 0)
- cout << dzielnik << '\t';
- }
- cout << n << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement