C++开平方函数和

    科技2025-11-20  8

    开平方函数

    pow函数就是开平方的函数

    用法是

    pow(a,b) a就是指数,b就是幂

    #include<iostream> #include<math.h> //pow的头文件 using namespace std; int main() { int a=10; cout<<pow(10,2); }

    平方函数

    sqrt()函数

    #include<iostream> #include<math.h> //sqrte头文件 using namespace std; int main() { int a=9; cout<<sqrt(a); }
    Processed: 0.011, SQL: 8