#include <iostream>
std::ostream& print_hex_to_stdout( int val, int width = 2 )
{
std::cout.width(width) ;
std::cout.fill('0') ;
return std::cout << std::hex << val ;
}
int main()
{
//0d007b02
int xx = 13, yy = 123, zz = 2 ;
print_hex_to_stdout(xx) ;
print_hex_to_stdout(yy,4) ;
print_hex_to_stdout(zz) << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RkOjpvc3RyZWFtJiBwcmludF9oZXhfdG9fc3Rkb3V0KCBpbnQgdmFsLCBpbnQgd2lkdGggPSAyICkKewogICAgc3RkOjpjb3V0LndpZHRoKHdpZHRoKSA7CiAgICBzdGQ6OmNvdXQuZmlsbCgnMCcpIDsKICAgIHJldHVybiBzdGQ6OmNvdXQgPDwgc3RkOjpoZXggPDwgdmFsIDsKfQoKaW50IG1haW4oKQp7CiAgICAvLzBkMDA3YjAyCiAgICBpbnQgeHggPSAxMywgeXkgPSAxMjMsIHp6ID0gMiA7CiAgICBwcmludF9oZXhfdG9fc3Rkb3V0KHh4KSA7CiAgICBwcmludF9oZXhfdG9fc3Rkb3V0KHl5LDQpIDsKICAgIHByaW50X2hleF90b19zdGRvdXQoenopIDw8ICdcbicgOwp9Cg==