Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FRadical(int n, int &x, int &y)
- {
- x = 1;
- y = 1;
- int d = 2, p;
- while(n != 1) {
- p = 0;
- while(n%d == 0)
- n/=d, p++;
- if(p) {
- if(p%2 == 0) {
- for(int k = 1; k <= p/2; k++) x*=d;
- }
- else {
- for(int k = 1; k <= (p-1)/2; k++) x*=d;
- y*=d;
- }
- }
- d++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement