작성일 :

문제 링크

3765번 - Celebrity jeopardy

설명

입력으로 주어진 각 줄을 그대로 출력하는 문제입니다.

입력이 끝날 때까지 반복합니다.


접근법

한 줄씩 읽어서 그대로 출력합니다.

입력이 끝나면 종료합니다.


Code

C#

1
2
3
4
5
6
7
8
9
10
using System;

class Program {
  static void Main() {
    string? line;
    while ((line = Console.ReadLine()) != null) {
      Console.WriteLine(line);
    }
  }
}

C++

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  string line;
  while (getline(cin, line))
    cout << line << "\n";

  return 0;
}