test cases not passed
Test cases not passed
#include using namespace std; # define R 10 # define C 10 void wavePrint(int a[R][C],int m,int n){ int i=0,j=0,wave_direction=1; while(j<n){ if(wave_direction==1){ for(int i=0;i<m;i++){ cout<<a[i][j]<<", β; } wave_direction=0; j++; } if(wave_direction==0){ for(int i=m-1;i>=0;iβ){ cout<<a[i][j]<<β, "; } wave_direction=1; j++; } } cout<<βENDβ; } int main(){ int m,n; int a[R][C]; cin>>m>>n; for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } wavePrint(a,m,n); return 0; }