#include <iostream>
using namespace std;
double dg(int x,int y)
{
if(y==0) return 1;
else return x*dg(x,y-1);
}
int main()
{
int x;
int y;
cout<<"请输入x和y"<<endl;
cin>>x;
cout<<endl;
cin>>y;
cout<<endl<<dg(x,y);
}
递归:求x的y次幂
猜你喜欢
转载自blog.csdn.net/weixin_46201191/article/details/104028782
今日推荐
周排行