Files
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

18 lines
418 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int x = 255; // FF
vector<int> 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;
}