public class houzichitao3 {
public static void main(String[] args) {
int day=9,x1=0,x2=1;
while (day>0)
{
x1=(x2+1)*2;
x2=x1;
day--;
}
System.out.println("第一天摘了:"+x1);
}
}
运行结果