Polnochniy

Untitled

Nov 9th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. void div_all(int N)
  4. {
  5. int n = N;
  6. for (int i = 1; i < n; i++)
  7. {
  8. if (n % i == 0)
  9. {
  10. cout << i << " ";
  11. }
  12. }
  13. }
  14. int main()
  15. {
  16. setlocale(LC_ALL, "Rus");
  17. int N;
  18. cout << "Введите число N. Выведите все его делители " << endl ;
  19. cin >> N;
  20. div_all(N);
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment