#include <stdio.h>
//**************************************************************
// Function: blackJackValue
// 
// Purpose: Calculates the total value of a number of euro coins of different values.
// 
// Parameters: 	card1 - char: the first card in your hand
//				card2 - char: the second card in your hand.
// 
// Returns: result - an integer representing hand value.
//			will return 0 if the hand is invalid.
//  
//**************************************************************    
       
int blackJackValue (char card1, char card2){
	int value = 0;
	int i;
	//make a short array and iterate over it so I can re-use the switch block
	char cards[2] = {card1, card2};
	for (i=0; i<2; i++) {
		//Determine value of card and add it to the running total
		switch (cards[i]) {
			case 'A':
				value+=11;
				break;
			case '2':
				value+=2;
				break;
			case '3':
				value+=3;
				break;
			case '4':
				value+=4;
				break;
			case '5':
				value+=5;
				break;
			case '6':
				value+=6;
				break;
			case '7':
				value+=7;
				break;
			case '8':
				value+=8;
				break;
			case '9':
				value+=9;
				break;
			case 'T':
			case 'J':
			case 'Q':
			case 'K':
				value+=10;
				break;
			default: //If it's an invalid card, return 0
				return 0;	
		}
	}
	return value;
}
int main(void) {
	// your code goes here
	printf("%d",blackJackValue('A', '#'));
	return 0;
}
