#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctime>
#include <fstream>
#include <sstream>
#include <cmath>
using namespace std;
//int to hex
string itoh( unsigned int x, int size) ;
//int to bin
string itob( unsigned int x, int size) ;
//bin to int
unsigned int btoi( string bin) ;
//hex to int
unsigned int htoi( string hex) ;
//char(0x**) to hex
string ctoh( unsigned char c) ;
//hex to bin
string htob( string hex) ;
//bin to hex
string btoh( string bin) ;
//float to hex
string ftoh( float f) ;
//hex to float
int main( ) {
// your code goes here
cout << itoh( 10 ,10 ) ;
return 0 ;
}
//int hex bin 型の変換
string itoh( int x, int size) {
char hexbuf[ 16 ] ;
string hexstr;
sprintf ( hexbuf, "%X" , x) ;
hexstr = hexbuf;
while ( hexstr.length ( ) < size) {
if ( x >= 0 ) hexstr = "0" + hexstr;
if ( x < 0 ) hexstr = "F" + hexstr;
}
while ( hexstr.length ( ) > size) {
hexstr.erase ( hexstr.begin ( ) ) ;
}
return hexstr;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y3RpbWU+CiNpbmNsdWRlIDxmc3RyZWFtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPGNtYXRoPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKLy9pbnQgdG8gaGV4CnN0cmluZyBpdG9oKHVuc2lnbmVkIGludCB4LCBpbnQgc2l6ZSk7Ci8vaW50IHRvIGJpbgpzdHJpbmcgaXRvYih1bnNpZ25lZCBpbnQgeCwgaW50IHNpemUpOwovL2JpbiB0byBpbnQKdW5zaWduZWQgaW50IGJ0b2koc3RyaW5nIGJpbik7Ci8vaGV4IHRvIGludAp1bnNpZ25lZCBpbnQgaHRvaShzdHJpbmcgaGV4KTsKLy9jaGFyKDB4KiopIHRvIGhleApzdHJpbmcgY3RvaCh1bnNpZ25lZCBjaGFyI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