pow(x,y);表示x的y次方
注意需要在头文件中引入math.h
例如求5的3次方:
#include #include#include//引入math头文件using namespace std;int main(){ int x=5,y=3,a; a=pow(5,3);//计算5的3次方 printf("%d ",a); return 0;}