Code: Select all
cout<<setiosflags(ios::fixed)<<setprecision(0)<<pow(p, 1.0/n)<<endl;
Code: Select all
k = pow(p, 1.0/n); printf("%.0lf\n",k);
With both ways n, p, k are defined as double. Let know if it worked with you.
Edit: Edited the codes.. forgot something to mention.