题解 | #汽水瓶#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
开心
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int n = scan.nextInt();
int count = 0;
if(n == 0) break;
while(n>=3){
count += n/3;
n = n/3+n%3;
}
if(n == 2){
count++;
}
System.out.println(count);
}
}
}