작성일 :

문제 링크

9316번 - Hello Judge

설명

각 테스트케이스 번호에 따라 Hello World, Judge i! 형식의 문자열을 출력하는 간단한 문제입니다.


접근법

  • 테스트케이스 수를 먼저 입력받습니다.
  • 1부터 해당 숫자까지 반복하며,
    각 줄마다 "Hello World, Judge i!" 형식의 문자열을 출력합니다.



Code

C#

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

class Program {
  static void Main() {
    int t = int.Parse(Console.ReadLine());
    for (int i = 1; i <= t; i++) {
      Console.WriteLine($"Hello World, Judge {i}!");
    }
  }
}

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);

  int t; cin >> t;
  for (int i = 1; i <= t; i++)
    cout << "Hello World, Judge " << i << "!\n";

  return 0;
}