#include<iostream>
using namespace std;
int main()
{
char letter;
// Get initial letter from user
cout << "Give me a letter: ";
cin >> letter;
// While input letter is not A or P,
// get new letter
while(letter!='A' && letter!='P')
{
cout << "Try again: ";
cin >> letter;
}
// When user enters right letter,
// announce apple or pear
if(letter=='A') // apple output
cout << "A is for apple!\n";
else // pear output
cout << "P is for pear!\n";
return 0;
}