백준/문자열
11718: 그대로 출력하기 / C++
Koalitsiya
2023. 3. 8. 15:24
문제
풀이
입력의 각 줄마다 입력받고 출력하도록 하고 빈 문자열을 입력받을 시 프로그램이 종료되도록 하였다.
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (true) {
getline(cin, s);
if (s.empty()) break;
cout << s << "\n";
}
return 0;
}