慕雪6442864
math库中有pow(x,y)函数,x为底数,y为指数,返回值为结果,如下:#include <stdlib.h>#include <math.h>#include<iostream>using namespace std;int main() {int x, y, result;cout<<"Enter x,y \n"<<endl;cin>>x>>y;result=pow(x,y);cout<<"\nthe result is:"<<result<<endl;system("pause");return 0;}