#include <iostream> #include <vector> using namespace std; void div(vector<int>& A, int b, vector<int>& res) { int r = 0; vector<int> C; for (int i = 0; i < A.size(); i++) { r = r * 10 + A[i]; C.push_back(r / b); r %= b; } // for(int i=0;i<C.size();i++) cout<<C[i]; // cout<<endl; //去除前导零 vector<int> temp; int i = 0; for (; i < C.size(); i++) { if (C[i] != 0) break; } if (i == C.size()) temp.push_back(0); for (; i < C.size(); i++) temp.push_back(C[i]); res.push_back(r);//存放每一次除法的余数 A = temp; } int main() { string a; while (cin >> a) { vector<int> A; vector<int> res; if (a.size() == 1 && a[0] == '0') res.push_back(0); for (int i = 0; i < a.size(); i++) A.push_back(a[i] - '0'); while (A.size() >= 1) { if (A.size() == 1 && A[0] == 0) break; else div(A, 2, res); } for (int i = res.size() - 1; i >= 0; i--) cout << res[i]; cout << endl; } return 0; } // 64 位输出请用 printf("%lld")