Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
  string pass = "friend", input;
  cout << "Speak, friend, and enter." << endl;
  cin >> input;
  if(pass == input) cout << "You passed." << endl;
  else              cout << "Go away." << endl;
  return 0;
}