题解 | #汽水瓶#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
#include<iostream>
using namespace std;
int main(){
int bottle =0;
int a=0 , b=0;
int sum=0;
while(cin >> bottle && bottle !=0){
int sum=0;
while(bottle>1){
a = bottle/3;
b = bottle%3;
sum += a;
bottle = a+b;
if((a+b)==2){
sum+=1;
bottle=0;
}
}
cout << sum << endl;
}
}