#include
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
int arr[10][10];
for(int row=0;row<m;row++)
{
for(int col=0;col<n;col++)
{
cin>>arr[row][col];
}
}
for(int col=0;col<n;col++)
{
if(col%2==0)
{
for(int row=0;row<m;row++)
{
cout<<arr[row][col]<<",";
}
}
else
{
for(int row=m-1;row>0;row–)
{
cout<<arr[row][col]<<",";
}
}
}
}
this is a problem of wave print .I have solved it on my compiler and it is giving correct answer but when I tried to submit this code on hacker blocks it is showing all testcases are failed
Wave print problem
@mohitshendre2609 hey ,output format dekho last me END bhi print krana hai:
All M * N integers seperated by commas with ‘END’ wriiten in the end(as shown in example).
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.