一道编程题,怎么运行不正确?
public class watermelon {
/**
* 有1020个西瓜,第一天卖一半多2个,以后每天卖剩下的一半多2个,
* 问几天以后能卖完
*/
public static void main(String[] args) {
int x1,x2,day;
x1=1020;
day=0;
while(x1==0){
x2=x1/2-2;
x1=x2;
day++;}
System.out.println("the day is "+day);
// TODO Auto-generated method stub
}
}
运行出错误~但是我怎么也看不出来,望指点!!