//计算一个数的乘方 x^y
class CF{
public int CF1(int x,int y){
if(x==1)
return 1;
else if(y==0)
return 1;
else if(y==1)
return x;
else if(y%2==1)
return CF1(x*x,y/2)*x;
else return CF1(x*x,y/2);
}
public static void main(String[] args){
CF c=new CF();
System.out.println(c.CF1(2,10));
}
}
class CF{
public int CF1(int x,int y){
if(x==1)
return 1;
else if(y==0)
return 1;
else if(y==1)
return x;
else if(y%2==1)
return CF1(x*x,y/2)*x;
else return CF1(x*x,y/2);
}
public static void main(String[] args){
CF c=new CF();
System.out.println(c.CF1(2,10));
}
}