S001-AC.cc
292 Bytes
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int x,bin;
cin >> x;
do
{
bin = 0;
for(int i = 0; i < 4; i++)
{
bin += (x & 0x01)*pow(2,i);
x = x >> 1;
}
cout << uppercase << hex << bin;
}while(x);
cout << endl;
return 0;
}