题解 | #进制转换#
进制转换
https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
#include <cstdio> #include <iostream> using namespace std; int main() { string hex; int ans; while (cin >> hex) { sscanf(hex.c_str(), "0x%x", &ans); cout << ans; } } // 64 位输出请用 printf("%lld")