题解 | 进制转换大整数除法加十进制转二进制
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
string s;
while (cin >> s) {
string ans;
while (!s.empty()) {
int remainder = 0;
string t;
for (char c:s) {
int digit = remainder * 10 + c - '0';
remainder = digit % 2;
if (!t.empty() || digit / 2) t += digit / 2 + '0';
}
s = t;
ans += remainder + '0';
}
reverse(ans.begin(), ans.end());
cout << ans << endl;
}
return 0;
}

