Calculation of the power of n x

Power means exponentiation result. refers to a ^ n multiplied by itself n times a, known as the power of a base number, called the exponent n, the result is called a power of the n-th power.

// 计算x的n次方
long Power(int x, int n)
{    
	int pow=1;    
	for(int i=1;i<=n;i++)    
	{        
		pow=pow*x;    
	}    
	return pow;
}
Published 44 original articles · won praise 35 · views 807

Guess you like

Origin blog.csdn.net/huangziguang/article/details/104447658