Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -4,11 +4,13 @@ | ... | @@ -4,11 +4,13 @@ |
4 | using namespace std; | 4 | using namespace std; |
5 | int main() { | 5 | int main() { |
6 | string s; | 6 | string s; |
7 | + cout << "if you enter 'exit', the program will exit"; | ||
7 | while (true) { | 8 | while (true) { |
8 | cin >> s; | 9 | cin >> s; |
9 | - cout << s << endl; | 10 | + if(s=="exit"){ |
11 | + break; | ||
10 | } | 12 | } |
11 | - | 13 | + cout << s << endl; |
12 | } | 14 | } |
13 | - | 15 | + exit(100); |
14 | } | 16 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment