#include #define rep(i,n) for(int i=0;i> n; n = Replace(n, "hamu", "1"); n = Replace(n, "ham", "0"); int ans = strbin2i(n); ans *= 2; string a; while (ans != 0) { if (ans % 2 == 1) { a = "hamu" + a; } else { a = "ham" + a; } ans /= 2; } cout << a << endl; }