#include<stdio.h>
int M=0;
void huanping(int c);
int main()
{
int n[1000]; // 瓶子数量
int i=0;
scanf("%d",&n[0]);
while(n[i]!=0)
{
i++;
scanf("%d",&n[i]);
}
for(int j=0;j<i;j++)
{
M=0;
huanping(n[j]);
printf("%d\n",M);
}
return 0;
}
void huanping(int c)
{
if(c<=1)
return;
if(c==2)
{
M++;return ;
}
int c1;
M=M+c/3;
c1=c/3+c%3; //compute the number of bottle after exchange
huanping(c1);
return ;
}
0.0分
0 人评分