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