in array wave column wise my code give answer after compiling but after submission all test case failed what is the wrong in this code
#include
using namespace std;
int main() {
int n,m;
int a[100][100];
cin>>n>>m;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cin>>a[i][j];
}
}
for(int i=0;i<n;i++)
{
if(i%2==0)
{
for(int j=0;j<m;j++)
{
cout<<a[j][i]<<","<<" ";
}
}
else
{
for(int j=(m-1);j>=0;j--)
{
cout<<a[j][i]<<","<<" ";
}
}
}
cout<<"END";
return 0;
}

