문제
https://www.acmicpc.net/problem/3765
3765번: Celebrity jeopardy
It’s hard to construct a problem that’s so easy that everyone will get it, yet still difficult enough to be worthy of some respect. Usually, we err on one side or the other. How simple can a problem really be? Here, as in Celebrity Jepoardy, questions
www.acmicpc.net
해결방법
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 > Baekjoon' 카테고리의 다른 글
| [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 |
댓글