#include <iostream>
using namespace std;
ostream &sethex(ostream &stream)
{
stream.unsetf(ios::dec | ios::oct);
stream.setf(ios::hex | ios::uppercase | ios::showbase);
return stream;
}
ostream &noset(ostream &stream)
{
stream.unsetf(ios::hex | ios::uppercase | ios::showbase);
stream.setf(ios::dec);
return stream;
}
int main()
{
cout << sethex << 65 << endl;
cout << noset << 65 << endl;
return 0;
}
/*
run:
0X41
65
*/