public class Test {
static int full = 0;//总共可以兑换多少
public static void calc(int empty) {
full = full + empty / 3;
empty = empty / 3 + empty % 3;
if (empty >= 3) {
calc(empty);
}else{
System.out.println("还剩空瓶子:"+empty);
}
}
public static void main(String[] args) {
calc(100);
System.out.println("总共可以兑换:"+full);
}
}