Advertisement
TwITe

Untitled

Sep 14th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. void task5() {
  2.     int n;
  3.     cin >> n;
  4.     for (int divisor = 2; divisor < n; i++) {
  5.         bool is_divisor_simple = true;
  6.         if (n % i == 0) {
  7.             for (int k = 2; k <= sqrt(i); k++) {
  8.                 if (i % k == 0 && i != 2) {
  9.                     is_divisor_simple = false;
  10.                     break;
  11.                 }
  12.             }
  13.             if (is_divisor_simple) {
  14.                 cout << i << " ";
  15.             }
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement