Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void radical(int n,int &x,int &y)
- {
- int e,d=2;
- y=n;
- x=1;
- while(n>1)
- {
- e=0;
- while(n%d==0)
- {
- n=n/d;
- e++;
- }
- for(int i=1;i<=e/2;i++)
- x=x*d;
- d++;
- }
- y=y/(x*x);
- }
- int main()
- {
- int n,x,y;
- cin>>n;
- radical(n,x,y);
- cout<<x<<" "<<y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement