6. Access Array Element

You are given an array of exactly 10 integers.
Write a function named get_element that provides direct access to an element of the array at a specified index.

The function will be used in main() exactly as provided.
Your implementation must satisfy all usages without modifying main().

  • The returned object must be modifiable
  • The returned object must have a stable memory address
  • Use the returned access to assign a new value to the selected element
  • Finally, print the updated array

 

Example 

Input:

1 2 3 4 5 6 7 8 9 10
3 99

Output:

1 2 3 99 5 6 7 8 9 10

 

Constraints:

  • The array size is fixed at 10 elements
  • The index is guaranteed to be in the range 0 ≤ index < 10
  • The returned object must refer to an existing array element
  • Returning a temporary object is not allowed
  • Do not modify the main() function

 

 

 

Loading...

Input

1 2 3 4 5 6 7 8 9 10 3 99

Expected Output

1 2 3 99 5 6 7 8 9 10