📅  最后修改于: 2022-03-11 14:52:21.708000             🧑  作者: Mango
public static int exponent(int n){
int ans;
if(n == 0)
return 1;
else if(n%2 == 0){
int k = exponent(n/2);
ans = k*k;
}
ans= 2 * exponent(n-1);
return ans ;
}