Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. long long np(double n,double x)
  5. {
  6. double p;
  7. double xx=x;
  8. p=(double)round((double)pow(double(xx),double(1/n)));
  9. p=round(p);
  10. return p;
  11. }
  12.  
  13. long long nroot(int n,long long x)
  14. {
  15. if(x<0)
  16. x=-x;
  17. x=np(n,x);
  18. return x;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement