ユーザーが Q を押しても、プログラムは終了しません。何が問題なのですか?? 助けてください
while (true)
{
//promt to user enter or quit
cout<<" Enter five digit number please or Q to quit \n";
cin>> buf; n = atoi (buf.c_str());
cin.ignore(1000,10);
if( n == 'q' || n == 'Q')
break;
a = n % 10;
b = n / 10000;
if ( ! a == b )
{
cout<< "This is not a palindrome \n";
continue;
}
// checking the palindrome
n = n % 10;
n = n / 100;
if ( a == b )
cout<<" This is palindrome\n";
else
cout<<" This is not a palindrome\n";
}