Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void divPrimMax(int n, int &p) {
- int cp = 2;
- bool hasPow;
- while (n > 1) {
- hasPow = false;
- while (n % cp == 0) {
- n /= cp;
- hasPow = true;
- }
- if (hasPow) {
- p = cp;
- }
- cp++;
- }
- }
- int main() {
- //call here
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement