← Back to STL Containers
Question 540
3x3 Grid with Nested std::array
3x3 Grid with Nested std::array
A variablegridof typearray<array<int, 3>, 3>has been declared for you. Fill the grid so that the cell in rowi, columnjholdsi * 3 + j, then print the grid: one row per line, the three values in a row separated by spaces.
Expected Output:
0 1 2 3 4 5 6 7 8
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
STL Containersstd::array
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.