本文共 418 字,大约阅读时间需要 1 分钟。
#include#include #include #include #include using namespace std;int fun(int n){ int ans = 0; while(n){ n /= 2; ans++; } return ans;}int main(){ int n; //将n开m次根 int m = 3; scanf("%d",&n); int k = fun(n);//n的二进制位 int now = n >> ((k-1)*(m-1)/m),last; do{ last = now; now = (last*(m-1)+n/(pow(last,m-1)))/m; }while(now < last); printf("%d\n",last); return 0 ;}
转载地址:http://enqp.baihongyu.com/