Showing time limit exceeded ,do reply what is the problem

#include
using namespace std;
int main() {

int n;
int m;
cin>>n>>m;
int a[10][10];
for (int i=0;i<n;i++)
{
	for (int j=0;j<m;j++)
	{
		cin>>a[i][j];
	}
}
for (int i=0;i<m;i++)
{
	if (i%2==0)
	{
		for (int row=0;row<n;row++)
		{
			cout<<a[row][i]<<" ";
		}
	}
	else
	{
		for (int row=n-1;row>=0;row--)
		{
			cout<<a[row][i]<<" ";
		}
	}
}

return 0;

}

@deck123 its working fine do it give tle on submitting?

yes, it gives time limit exceeded

@deck123 missing , and end here corrected (output style wrong)


dont forget to hit like and mark resolved if cleared :smiley:

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.