In wave print question of araay
Here is my code:
#include
using namespace std;
int main() {
int m,n;
cin>>m>>n;
if(m>10||n>10)
{
return 0;
}
int arr[10][10];
for (int i = 1; i <= m; i++)
{
for (int j = 1; j <= n; j++)
{
cin >> arr[i][j];
}
}
for (int i = 1; i <= m; i++)
{
if ((i % 2) == 1)
{
for(int j=1;j<=n;j++)
{
cout << arr[j][i] << ","<<" ";
}
}
else if((i%2)==0)
{
for (int j = n; j >= 1; j--)
{
cout << arr[j][i] << ","<<" ";
}
}
}
cout << "END";
return 0;
}