#include <iostream>
#include <string>
#include <vector>
using namespace std;
string toHexString(int n);
int main() {
int n;
cin >> n;
string hexStr = toHexString(n);
cout << hexStr << endl;
return 0;
}
string toHexString(int n) {
// write your code here......
string s = "";
string s1 = "0123456789ABCDEF";
while (n != 0) {
int num = n % 16;
s = s + s1[num] ;
n = n / 16;
}
string s2;
for (int i = s.length() - 1; i >= 0; i--) {
s2.push_back(s[i]);
}
return s2;
}

京公网安备 11010502036488号