1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <iostream>
constexpr std::size_t MAXSIZE{ 9 };
int main()
{
int arr[MAXSIZE][MAXSIZE]{
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9},
{1, 2, 3, 4, 5, 6, 7, 8, 9}
}; // <--- Setup for testing.
// After reading the file and filling the array.
for (size_t row = 0; row < MAXSIZE; row++)
{
for (size_t col = 0; col < MAXSIZE; col++)
{
std::cout << arr[row][col] << (col + 1 < 9 ? ", " : "\n");
}
}
std::cout << "\n\n\n\n Press Enter to continue";
std::cin.get();
return 0;
}
|