题解 | #汽水瓶#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
#include <bits/stdc++.h>
using namespace std;
int main(){
int i;
int count;
while(cin>>i){
if(i==0) return 0;
count=0;
while(i>=2){
if(i>=3){
count+=i/3;
i=i%3+i/3;
}else{
count++;
i=0;
}
}
cout<<count<<endl;
}
return 0;
}