#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { string bint; long long sum = 0; while (cin >> bint) { for (long long i = bint.length()-1; i >=0 ;i--) { sum += (bint[i]-'0') * (long long)pow(2, bint.length() - i - 1); } string ch = "0123456789ABCDEFGHIJKLMNOPQRSTUV"; vector<char> vt; while (sum) { vt.push_back(ch[sum % 32]); sum = sum / 32; } if (vt.size() == 0) { cout << "0"; } for (int i = vt.size() - 1; i >= 0; i--) { cout << vt[i]; } cout << endl; } return 0; }
全部评论
(0) 回帖