提交时间:2020-08-23 19:27:08

运行 ID: 6080

#include<bits/stdc++.h> using namespace std; int main(){ int n; while(scanf("%d",&n)&&n){ int sum=0; while(n>=2){ sum+=n/3; n=n/3+n%3; if(n==2){ sum++; break; } } cout<<sum<<endl; } return 0; }