// 10進数を16進数表示(再帰版) #include using namespace std; hex(int n) { string h="0123456789ABCDEF"; int a=n/16; int b=n%16; if(a>0){ hex(a); } cout << h[b]; } int main() { for(int i=0; i<=300; i+=13){ cout << i << " -> "; hex(i); cout << endl; } return 0; }