Advertisement
NIKOLAY_TETUS

Untitled

Jun 17th, 2021
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int getM(int x)
  8. {
  9.     int minDel = 999999999;
  10.     int maxDel = -99999999;
  11.  
  12.     for (int i = 2; i < x; i++)
  13.         if (x % i == 0)
  14.         {
  15.             if (i > maxDel)
  16.                 maxDel = i;
  17.  
  18.             if (i < minDel)
  19.                 minDel = i;
  20.         }
  21.  
  22.     return maxDel - minDel;
  23. }
  24.  
  25. int main()
  26. {
  27.     int count = 0;
  28.     int i = 450000;
  29.  
  30.     while (count < 3)
  31.     {
  32.         if (getM(count) % 29 == 11)
  33.             cout << count << getM(count) << endl;
  34.  
  35.         i++;
  36.     }
  37.  
  38.     return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement