zhishu.java

wxy
游镇嘉 4 years ago
parent c232251a26
commit 2c8cb7c6e6

@ -0,0 +1,17 @@
public class zhishu{
  public double zhishudouble xdouble y {
  if (y==0)
return 1;
else if(y==1)
return x;
else if(oushu(y))
return zhishu(x*x,y/2);
else return zhishu(x*x,(y-1)/2)*x
  }
private boolean oushu(int n){
if(n%2==0)
return true;
else return false;
}
}
Loading…
Cancel
Save