30分求助
#include <iostream> using namespace std; int main() { int n,k; int s = 0; cin >> n; while(n) { s++; if(k==0 && n%3==1) { k = s; } if(n%3==0) { n -= n/3; } else { n -= n/3+1; } } cout << s << " " << k; return 0; }