Advertisement
madidino

teza14-sub3-2

Feb 21st, 2024
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int regulat(int n)
  5. {
  6.     int i=2;
  7.     int x=n;
  8.     while(x!=1)
  9.     {
  10.         while(x%i==0)
  11.         {
  12.             x/=i;
  13.         }
  14.         if(x>1)
  15.         {
  16.             i++;
  17.         }
  18.     }
  19.     if(i>5)
  20.     {
  21.         regulat(n-1);
  22.     }
  23.     else
  24.     {
  25.         return n;
  26.     }
  27. }
  28. int main()
  29. {
  30.     cout<<regulat(44);
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement