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