문제
https://www.acmicpc.net/problem/3765
해결방법
getline으로 입력값이 없을 때까지 입력받고 그대로 출력하면 된다.
코드
#include<iostream>
#include<string>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string str;
while (getline(cin, str)) {
cout << str << '\n';
}
return 0;
}
'PS > 백준' 카테고리의 다른 글
[C++] 백준 5357: Dedupe (0) | 2023.05.09 |
---|---|
[C++] 백준 11257: IT Passport Examination (0) | 2023.05.08 |
[C++] 백준 21638: SMS from MCHS (0) | 2023.05.06 |
[C++] 백준 24072: 帰省 (Homecoming) (0) | 2023.05.05 |
[C++] 백준 21354: Äpplen och päron (1) | 2023.05.04 |
댓글