#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPGNvbmlvLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CglzZXRsb2NhbGUoTENfQUxMLCAiUnVzc2lhbiIpOwoKCXN0cmluZyBmaXJzdF9uYW1lOwoJc3RyaW5nIGxldHRlcl9pbnRybzsKCXN0cmluZyBmcmllbmRfbmFtZTsKCWNoYXIgZnJpZW5kX3NleDsKCWludCBhZ2U7CgoJZnJpZW5kX3NleCA9IDA7CglhZ2UgPSAwOwoKCWNvdXQgPDwgIkVudGVyIGFuIGFkZHJlc3NhbnQgbmFtZTogIjsKCWdldGxpbmUoY2luLCBmaXJzdF9uYW1lKTsKCWNvdXQgPDwgIkVudGVyIGFuIGludHJvZHVjdGlvbiBvZiB0aGUgbGV0dGVyOiAiOwoJZ2V0bGlu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