#include <iostream> 
using namespace std; 
  
int main() 
{ 
  cout << "Approach the curb." << endl;
  while (true) 
  { 
    char answer; 
    cout << "Look both ways. Is it clear [Y/N]? "; 
    cin >> answer; 
    cin.ignore(1000, 10); 
  
    if (answer == 'Y' || answer == 'y') break; 
  } // while 

  cout << "It's safe to cross!" << endl;
} // main
