Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int num{ 0 };
- std::cout << "Enter number\n";
- std::cin >> num;
- for (int divisor{ 1 }, divSquare; divSquare = divisor * divisor, divSquare < num; ++divisor)
- {
- if (num % divSquare == 0 and num % (divSquare*divisor) != 0)
- {
- std::cout << divisor << ' ';
- }
- }
- std::cout << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement