-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_world.cpp
44 lines (34 loc) · 868 Bytes
/
hello_world.cpp
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
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
inline void keep_window_open() {char ch; cin>>ch; }
int main() {
cout << "Enter your name: \n";
string first_name;
cin >> first_name;
cout << "Hello " << first_name << "!\n";
cout << "Enter the name of the person you want to write to\n";
string correspondant;
cin >> correspondant;
string friend_name;
cout << "friend_name:";
cin >> friend_name;
char friend_sex;
cout << "sex";
cin >> friend_sex;
int friend_age;
cout << "age";
cin >> friend_age;
cout << "Dear " << correspondant << ", \n";
cout << " How are you? ";
if (friend_sex == 'm') {
cout << "If you see" << friend_name << "tell him I said hi\n";
}
else {
cout << "If you see" << friend_name << "tell her I said hi\n";
}
return 0;
}