1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iostream>
#include <iomanip>
int main()
{
int sally [3] [4] = {{1,5,8,10},{3,5,6,9}, {7,9,4,5}};
// 1, 5, 8, 10
// 3, 5, 6, 9
// 7, 9, 4, 5
//column
// O, 1, 2, 3
for ( const auto &row : sally )
{
for ( int x : row ) std::cout << std::setw( 2 ) << x << ' ';
std::cout << std::endl
}
return 0;
}
|