1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include "std_lib_facilities.h"
#include <iostream>
#include <string>
#include "Test.h"
using namespace std;
int main()
{
string first_name, friend_name, mail_1,/* mail_2, mail_3,*/ sign_1, sign_2, skype, phone;
char friend_sex = 0, f = 0, m = 0;
int age;
cout << "Please inpute name of receiver: " << endl;
getline (cin, first_name);
cin.clear();
cin.sync();
cout << "Please inpute mail: " << endl;
getline (cin, mail_1);
//getline (cin, mail_2);
//getline (cin, mail_3);
cin.clear();
cin.sync();
cout << "Please input friend name: " << endl;
getline (cin, friend_name);
cin.clear();
cin.sync();
cout << "What gender your friend is? Input f or m." << endl;
cin >> friend_sex;
cin.sync();
cout << "Please input age of receiver: " << endl;
cin >> age;
cin.sync();
cout << "Please input sign here: " << endl;
cin >> sign_1 >> sign_2;
cin.sync();
cout << "Please input skype: " << endl;
cin >> skype;
cin.sync();
cout << "Please input phone: " << endl;
getline (cin, phone);
//cin >> phone;
cin.clear();
cin.sync();
cout << "Dear " << first_name << "," << endl
<< mail_1 << endl
//<< mail_2 << endl
//<< mail_3 << endl
<< "Did you see " << friend_name << " recently?" << endl;
if (friend_sex == 'f') cout << "If you will see " << friend_name << " please tell her to call me." << endl;
else if (friend_sex == 'm') cout << "If you will see " << friend_name << " please tell him to call me." << endl;
if (age <= 0) simple_error("Are you kidding me?");
else if (age >= 110) simple_error("Are you kidding me?");
else cout << "I hear you just throw a birthday party. You turn " << age << endl;
if (age == 12) cout << "Next year you will hit " << ++age << endl;
else if (age == 18) cout << "You can vote next year!" << endl;
else if (age > 60) cout << "I hope you don't boring at retirement." << endl;
cout << "With best regards, " << sign_1 << " " << sign_2 << endl
<< "Skype: " << skype << ";" << endl
<< "Phone: " << phone << ";" << endl;
}
|