#include using namespace std; int main() { int x = 255; // FF vector path; // 动态数组 while (x) { int a = x % 16; path.push_back(a); x /= 16; } for (int i = path.size() - 1; i >= 0; i--) { if (path[i] < 10) cout << path[i]; else printf("%c", 'A' + (path[i] - 10)); } return 0; }