#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
double B, N;
double s1, s2, A, con;
int pos;
while (cin >> B >> N)
{
for (A = 0;; ++A)
{
if (pow(A, N) <= B && pow(A + 1,N) >= B)
{
pos = A;
break;
}
}
s1 = B - pow(A, N);
s2 = pow(A + 1, N) - B;
con = min(s1, s2);
if (con == s1)
cout << A << endl;
else
cout << A + 1 << endl;
}
return 0;
}
zju2818
最新推荐文章于 2018-03-11 12:11:00 发布