📅  最后修改于: 2022-03-11 14:44:47.041000             🧑  作者: Mango
int pow(int base, int exp)
{
if(exp < 0)
return -1;
int result = 1;
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}
return result;
}