Submit error in this code

compile and text case are correct but no submit our code
#include
using namespace std;
int main() {
int n,m;
cin >> n>> m;
int a[1000][1000];

for(int i=0;i<n;i++)

{
for(int j=0;j<m;j++)
{

cin>>a[i][j];

}

}
for(int j=0;j<n;j++)
{
if(j%2==0) //t
{
for(int i=0; i<n;i++)
{
cout<<a[i][j]<< " ,";
}
}
else
{
for( int i=m-1;i>=0;i–){
cout<<a[i][j]<< " ,";
}
}
}
cout<<“END”<<endl;
}

@abhinav17 while taking input you have used n as row and m as column but when you are printing you have mixed them, look carefully at for loops while printing, j should be iterating over m and i over n.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.