#include
using namespace std;
int main()
{
int n=3,m=4;
int row,col;
int a[3][4];
for ( col = 0; col < m; col++)
{
if (col%2==0)
{
for (row = 0; row < n; row++)
{
cout<<a[row][col]<<' ';
}
}
else
{
for (row = n-1; row >=0; row--)
{
cout<<a[row][col]<<' ';
}
}
}
cout<<endl;
return 0;
// not able to find the error