你好吗! #include <iostream> #include <iomanip> unsigned char arr[] = {4, 85, 250, 206}; for (const auto & elem : arr) { std::cout << std::setfill('0') << std::setw(2) << std::uppercase << std::hex << (0xFF & elem) << " "; } 原文由 truthadjustr 发布,翻译遵循 CC BY-SA 4.0 许可协议
你好吗!