송민석

Added exit func in echo.cpp

Showing 1 changed file with 7 additions and 3 deletions
...@@ -5,10 +5,14 @@ using namespace std; ...@@ -5,10 +5,14 @@ using namespace std;
5 int main(){ 5 int main(){
6 string str; 6 string str;
7 while(1){ 7 while(1){
8 - cout << "Implements echo program\nInput >> "; 8 + cout << "Implements echo program\n";
9 + cout << "If you want exit, Input \"exit\" : ";
9 cin >> str; 10 cin >> str;
10 - cout << "Output >> " << str << endl; 11 + if(str == "exit"){
12 + exit(100);
13 + }
14 + else cout << "Output >> " << str << endl;
11 } 15 }
12 -
13 return 0; 16 return 0;
14 } 17 }
18 +
......