김다솔

exit function added

...@@ -2,17 +2,29 @@ ...@@ -2,17 +2,29 @@
2 #include<iostream> 2 #include<iostream>
3 using namespace std; 3 using namespace std;
4 4
5 +void Exit(string words)
6 +{
7 + if (words == "exit")
8 + {
9 + exit();
10 + }
11 +
12 + return;
13 +}
14 +
5 void EchoProgram() 15 void EchoProgram()
6 { 16 {
7 string words; 17 string words;
8 18
9 cout << "Enter what you want to say : "; 19 cout << "Enter what you want to say : ";
10 cin >> words; 20 cin >> words;
21 + Exit(words);
11 cout << "\n\"" << words << "\"\n\n"; 22 cout << "\n\"" << words << "\"\n\n";
12 23
13 return; 24 return;
14 } 25 }
15 26
27 +
16 int main() 28 int main()
17 { 29 {
18 while (1) 30 while (1)
......