004-006-006
Array Copy: Recipe Ingredients List
Easy
Problem Description
Array Copy: Recipe Ingredients List
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
Examples
Example 1: Copy 3 Ingredients
Input:
3
eggs
milk
sugar
Output:
=== Recipe Ingredients ===
Original Recipe:
1. eggs
2. milk
3. sugar
Copied Recipe:
1. eggs
2. milk
3. sugar
Total Ingredients: 3 items
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up