// 将十六进制补码字符串转化为十进制整数, 32 位 long long a = stoll(s, 0, 16); long long res = a; if(a >= 1ll << 31) res = a - (1ll << 32);