#include<iostream>
using namespace std;
int judge(int n);
int main(){
int n;
while(cin>>n){
if(n == 0) break;
int result = judge(n);
cout<<result<<endl;
}
}
int judge(int n){
int rest = n;
int sum = 0;
while(rest > 1){
if(rest == 2){
sum = sum + 1;
return sum;
}
sum = sum + rest/3;
rest = rest/3 + rest%3;
}
return sum;
}
汽水瓶
最新推荐文章于 2022-08-04 21:53:43 发布