#include <iostream> #include <string> using namespace std; int main() { string str; while (cin >> str) { try { // 尝试将字符串转换为十六进制整数 cout << stoi(str, nullptr, 16) << endl; } catch (invalid_argument& e) { // 捕获无效输入异常 cout << "无效输入: " << str <&l...