Math::Pow 方法
语法:
Visual C++ |
---|
public: static double Pow( double x, double y ) |
参数
-
x
-
类型:
System::Double
要乘幂的双精度浮点数。
-
y
-
类型:
System::Double
指定幂的双精度浮点数。
返回值
类型: System::Double数字 x 的 y 次幂。
代码:#include<iostream>
#include<math.h>
using namespace std;
void main()
{
double x,y;
cout<<"x的y次幂,请输入x与y"<<endl;
cin>>x>>y;
cout<<pow(x,y)<<endl;
}