c++ key input

#include <iostream>
using std::cout;
using std::cin;

int main()
{
  char thing;

  cin >> thing;
  if (thing == 'a')
    cout << "You pressed 'a'!\n";
  else
    cout << "You pressed not-'a': " << thing << "\n";
  return 0;
}