Problem with ide
In the question Array-wave print column wise, the code is working fine in coding blocks online ide and while running the example as given in input it is showing correct result, but i am unable to pass any test case while submitting the solution . please look into the matter.
THe code is as follow :
include
using namespace std; int main() { int m,n; cin>>m>>n; 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;
}