Showing
1 changed file
with
9 additions
and
0 deletions
| 1 | #include <iostream> | 1 | #include <iostream> |
| 2 | #include <string> | 2 | #include <string> |
| 3 | 3 | ||
| 4 | +bool exit(string a) { | ||
| 5 | + if (a == "exit") | ||
| 6 | + return 1; | ||
| 7 | + else return 0; | ||
| 8 | +} | ||
| 9 | + | ||
| 4 | using namespace std; | 10 | using namespace std; |
| 5 | 11 | ||
| 6 | int main() { | 12 | int main() { |
| ... | @@ -8,6 +14,9 @@ int main() { | ... | @@ -8,6 +14,9 @@ int main() { |
| 8 | string a; | 14 | string a; |
| 9 | cout << "출력하고 싶은 것을 입력하시오 : "; | 15 | cout << "출력하고 싶은 것을 입력하시오 : "; |
| 10 | cin >> a; | 16 | cin >> a; |
| 17 | + if (exit(a)) { | ||
| 18 | + break; | ||
| 19 | + } | ||
| 11 | cout << endl <<"입력한 글자는 : "<< a << endl; | 20 | cout << endl <<"입력한 글자는 : "<< a << endl; |
| 12 | } | 21 | } |
| 13 | } | 22 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment