[백준 9316] Hello Judge (C#, C++) - soo:bak
작성일 :
문제 링크
설명
각 테스트케이스 번호에 따라 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;
}