- #include <iostream>
- using namespace std;
- int main () {
- int x, k;
- cin >> x;
- if (x == 0) cout << 0 << endl;
- else {
- while ( x > 0) {
- k = x % 16;
- x = x / 16;
- if ( k == 10 ) {
- cout << "A";
- }
- else if ( k == 11 ) {
- cout << "B";
- }
- else if ( k == 12 ) {
- cout << "C";
- }
- else if ( k == 13 ) {
- cout << "D";
- }
- else if ( k == 14 ) {
- cout << "E";
- }
- else if ( k == 15 ) {
- cout << "F";
- }
- else cout << k;
- }
- }
- }