سلام
اگه ممکنه کمکم کنید .
چند تا الگوریتم برای حل a به توان n

float pow(float x,int n)
{
float y=1;
for(int i=0;i<n;++i)
y*=x;
return y;
}
#include <iostream>
using namespace std;
float xton(int base,int pow)
{
int y;
if(pow==0)
return 1;
else if(pow==1)
return base;
else
{
y=xton(base,pow/2);
if(!(pow%2))
return y*y;
else
return y*y*base;
}
}
int main()
{
int base,pow;
cout<<"please enter the base:";
cin>>base;
cout<<"please enter the power:";
cin>>pow;
cout<<xton(base,pow);
return 0;
}