c++ 如何开N次方?速解 不在窝里 2020-04-28 396 阅读1分钟 直接上代码 #include <iostream> #include <cmath> using namespace std; typedef long long LL; int main() { LL a = 625; LL s = pow(a,1.0/4); cout<<"pow开方:"<<s<<endl; return 0; } 说明一下: pow中的第二个参数必须是1.0 / N,或者 1 / N.0的结构,1/4这样的都是整数,开平方开不出来。