public class Demo {
08 static int total(int day) {
09 if (day == 10) {
10 return 1;
11 } else {
12 return (total(day + 1) + 1) * 2;
13 }
14 }
15
16 public static void main(String[] args) {
17 System.out.println("第一天共有 " + total(1) + " 个桃子");
18 }
19 }