Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void task5() {
- int n;
- cin >> n;
- for (int divisor = 2; divisor < n; i++) {
- bool is_divisor_simple = true;
- if (n % i == 0) {
- for (int k = 2; k <= sqrt(i); k++) {
- if (i % k == 0 && i != 2) {
- is_divisor_simple = false;
- break;
- }
- }
- if (is_divisor_simple) {
- cout << i << " ";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement