004-006-002

Array Copy: Recipe Ingredients List

Easy

Problem Description

array Copy: Recipe Ingredients List

In this problem, you will create a program that reads ingredient names into a string array, copies them to a new array, and displays both the original and copied arrays side by side.

Learning Objective: Copy string array elements to another array

Manage recipe ingredient lists. Copy original recipe ingredients to a new array and display both lists side by side.

Input

Line 1: Number of ingredients n (1-5)
Following lines: Ingredient names (n items)

Output

=== Recipe Ingredients ===
Original Recipe:
1. [ingredient1]
2. [ingredient2]
...

Copied Recipe:
1. [ingredient1]
2. [ingredient2]
...

Total Ingredients: [n] items
```java

## Examples

### Example 1: Copy 3 Ingredients
Input:
```java
3
eggs
milk
sugar
```java
Output:
```java
=== Recipe Ingredients ===
Original Recipe:
1. eggs
2. milk
3. sugar

Copied Recipe:
1. eggs
2. milk
3. sugar

Total Ingredients: 3 items

Test Cases

※ Output examples follow programming industry standards

Normal case
Input:
3
Egg
Milk
Sugar
Expected Output:
=== Recipe Ingredients ===
Original Recipe:
1. Egg
2. Milk
3. Sugar

Copied Recipe:
1. Egg
2. Milk
3. Sugar

Total Ingredients: 3 items
Normal case
Input:
2
Butter
Flour
Expected Output:
=== Recipe Ingredients ===
Original Recipe:
1. Butter
2. Flour

Copied Recipe:
1. Butter
2. Flour

Total Ingredients: 2 items

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 10 free executions remaining