C++题解 | #汽水瓶 10行代码#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
#include <iostream>
using namespace std;
int main(){
int N;
while(cin >> N){
if(N == 0) return 0;
int count = 0;
while(N >= 3){
count += N / 3;
N = N / 3 + N % 3;
}
if(N == 2)
count++;
cout << count << endl;
}
}