每两个空瓶子可以换一个瓶子,有些取巧。
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int emptyBottle = sc.nextInt();
if (emptyBottle != 0) {
System.out.println(emptyBottle / 2);
}
}
}
}