提交时间:2020-08-23 16:07:02

运行 ID: 5999

#include<bits/stdc++.h> using namespace std; int b,k=1,sum; int main(){ while(k){ cin>>b; sum=0; if(b==0) break; while(b/3){ sum+=b/3; b=b/3+b%3; } if(b==2) cout<<sum+1<<endl; else cout<<sum<<endl; } return 0; }