Advertisement
maxim_shlyahtin

25

Feb 1st, 2022
1,178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int m(int n) {
  7.     int count = 0, res = 1;
  8.     for (int i = 2; i <= n / 2; i++) {
  9.         if (n % i == 0) { count++; res *= i; }
  10.         if (count == 5) { break; }
  11.     }
  12.     if (count == 4) { res *= n; }
  13.     else if (count < 4) { return 0; }
  14.     else { return res; }
  15. }
  16.  
  17.  
  18. int main() {
  19.     int i = 200000001, count = 0;
  20.     while (count != 5) {
  21.         if (m(i) > 0 && m(i) < i) { count++; cout << m(i) << endl; }
  22.         i++;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement