///////
//
// Student: Russell Lowke
//     T.F: Francis Crick
// Unit Four, pencil-and-paper - question 1 [worth 2pts],  7/9/2002
//
//  Hexadecimal notation (base 16) uses the upper-case letters A
//  through F to represent the numbers 10 through 15, respectively
//

const int HEX = 16;

void writeHex (int n)
{	
	if (n >= HEX) {
		writeHex( (n / HEX) );
	}
	
	switch( n % HEX )
	{
		case 0:  cout << '0'; break;
		case 1:  cout << '1'; break;
		case 2:  cout << '2'; break;
		case 3:  cout << '3'; break;
		case 4:  cout << '4'; break;
		case 5:  cout << '5'; break;
		case 6:  cout << '6'; break;
		case 7:  cout << '7'; break;
		case 8:  cout << '8'; break;
		case 9:  cout << '9'; break;
		case 10: cout << 'A'; break;
		case 11: cout << 'B'; break;
		case 12: cout << 'C'; break;
		case 13: cout << 'D'; break;
		case 14: cout << 'D'; break;
		case 15: cout << 'F'; break;
	}
}