c++ 如何開N次方?速解
直接上代碼
#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這樣的都是整數,開平方開不出來。

