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