爆零代码如下:
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int n,num=0,ans=0;
int main() {
freopen("apple.in", "r", stdin);
freopen("apple.out", "w", stdout);
scanf("%d",&n);
while(n){
ans++;
if(n%3==1&&num==0) num=ans;
if(n%3==0) n-=n/3;
else n-=n/3+1;
}
printf("%d %d \n",ans,num);
return 0;
}
谢谢救助!!!