#include <iostream>
#include <string>
#include <stdio.h>
#include <conio.h>

using namespace std;

int main()
{
	setlocale(LC_ALL, "Russian");

	string first_name;
	string letter_intro;
	string friend_name;
	char friend_sex;
	int age;

	friend_sex = 0;
	age = 0;

	cout << "Enter an addressant name: ";
	getline(cin, first_name);
	cout << "Enter an introduction of the letter: ";
	getline(cin, letter_intro);
	cout << "Enter the name of your best friend: ";
	getline(cin, friend_name);
	cout << "Enter sex of your best friend: ";

	while ( (friend_sex != 'm') && (friend_sex != 'f') )
	{
		cin >> friend_sex;
		cout << "Enter f or m: ";
	}

	cout << "Enter age of the addressant: ";
	cin >> age;

	if (0 <= age <= 110)
	{
		cin >> age;
		cout << "You're kidding!";
	}

	cout << "Dear "
		<< first_name
		<< ". "
		<< letter_intro
		<< " Haven't you seen "
		<< friend_name
		<< " lately? ";

	if (friend_sex == 'm')
	{
		cout << "If you'll see " << friend_name << " tell him please to call me.";
	}
	if (friend_sex == 'f')
	{
		cout << "If you'll see " << friend_name << " tell her please to call me.";
	}

	cout << "\nI heard that you just celebrate your birthdate and you are " << age << " years old!";


	_getch();
	return 0;
}