Advertisement
STANAANDREY

bacT1 sIII 1

May 24th, 2021
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void putere(int n, int &d, int &p) {
  6.     int dmax, pmax = 0;
  7.     d = 2;
  8.     while (n > 1) {
  9.         p = 0;
  10.         while (n % d == 0) {
  11.             n /= d;
  12.             p++;
  13.         }
  14.         if (p) {
  15.             if (p >= pmax) {
  16.                 pmax = p;
  17.                 dmax = d;
  18.             }
  19.         }
  20.         d++;
  21.         p = 0;
  22.     }
  23.     p = pmax;
  24.     d = dmax;
  25. }
  26.  
  27. int main() {
  28.     //call here
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement