004-001-004

Array Variable Declaration: Names Array Creation

Easy

Problem Description

Array Variable Declaration: Names Array Creation

Learning Objective: Learn how to declare and use string arrays

Create a program that inputs two names, stores them in an array, and displays the array elements.

Input

Line 1: Name 1 (string)
Line 2: Name 2 (string)

Output

Name 0: [name1]
Name 1: [name2]

Test Cases

※ Output examples follow programming industry standards

Input:
Alice
Bob
Expected Output:
Name 0: Alice
Name 1: Bob
Input:
Tanaka
Suzuki
Expected Output:
Name 0: Tanaka
Name 1: Suzuki
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 6 free executions remaining