This isn't malfunctioning, this is behaving exactly as programmed: the operation "cin>>a" fails because "letters" are not a value of type double, and the operation "cin>>b" also fails because you haven't corrected the first error.
If you are using one letter you should just use a char type:
char a;
This holds one character of either a letter or number.
it will save memory and if you want a short string use an array of characters.
char a [10]; // this holds up to ten characters.
Remember this: A numeric value, such as an integer, is stored as a binary code in the computer and for this to but printed out on the screen, cout (which is a smart object) must convert the number into a stream of single characters.