package www.zhoushuiping.com; |
public class ShiJiuTi { |
public static void main(String[] args) { |
|
|
System.out.println(eat( 10 , 1 )); |
} |
|
|
|
|
public static int eat( int tianshu, int taozishu) { |
if (tianshu== 0 ) { |
return taozishu; |
} else { |
tianshu = tianshu - 1 ; |
return eat(tianshu,(taozishu+ 1 ) * 2 ) ; |
} |
} |
} |