提交时间:2020-08-23 19:36:52
运行 ID: 6097
#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; }