004-009-003
Accessing Multidimensional Array Elements: Seating Chart
Easy
Problem Description
Accessing multidimensional array Elements: Seating Chart
In this problem, you will create a program that reads a seating chart stored as a 2D array, accesses a specific seat using row and column indices, and displays the result to standard output.
Learning Objective: Access specific elements in a 2D array
Retrieve the name of a person sitting at a specific seat from a seating chart. Access elements by specifying row and column numbers.
Input
Line 1: Number of rows r (1-3) and columns c (1-3)
Following lines: Names for each row (space-separated)
Last line: Row number and column number to access (0-indexed)
Output
Seat[row][col]: [name]
Example
Input:
2 3
Taro Hanako Yuki
Ken Mika Ryo
1 2
Output:
Seat[1][2]: Ryo
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