C++ math库的使用 pow()函数sqrt()函数 #define _CRT_SECURE_NO_DEPRECATE //兼容C的标准格式 #include<iostream> #include<cmath> int main() { using namespace std; int people_num; double x = 36; x = sqrt(x); cout << "x=36,开根号= " << x<<endl; x = pow(6, 3); cout << "x=6^3= " << x << endl; system("pause"); return 0; }