Polnochniy

Untitled

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