Advertisement
WiktorJagielski

Zad 16

Mar 30th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5. int DZIELNIKI(int a)
  6. {
  7. for (int i=a;i>=1;i--)
  8. {
  9. if (a%i==0)
  10. {
  11. cout << i << " ";
  12. }
  13.  
  14. }
  15.  
  16. }
  17. int main()
  18. {
  19. int a;
  20. cout << "Podaj liczbe ktorej chcesz poznac wszystkie dzielniki: ";
  21. cin >>a;
  22. cout << "Dzielniki to: "; DZIELNIKI(a);
  23.  
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement