Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. long long d,k,n,i,Max,Max1;
  4. int main()
  5. {
  6. cin>>n;
  7. for(d=2;d*d<=n;d++)
  8. {
  9. k=0;
  10. while(n%d==0)
  11. {
  12. k++;
  13. n=n/d;
  14. }
  15. if(k>=Max)
  16. {
  17. Max=k;
  18. Max1=d;
  19. }
  20. }
  21. if(n!=1)
  22. {
  23. k=1;
  24.  
  25. if(k>=Max)
  26. {
  27. Max=k;
  28. Max1=n;
  29. }
  30. }
  31. cout<<Max1;
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement