#include
using namespace std;
int main() {
int r,c;
cin>>r>>c;
int arr[r][c];
int startrow = 0;
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
cin>>arr[i][j];
}
}
if(1<=r<=10 and 10>=c>=1){
while(startrow<r)
{
for(int i=0;i<r;i++)
{
cout<<arr[i][startrow]<<","<<" β;
}
startrow++;
for(int j=r-1;j>=0;jβ)
{
cout<<arr[j][startrow]<<β,"<<" ";
}
startrow++;
}
}
cout<<βENDβ;
return 0;
}
All test cases not running
@supratik260699
hello Supratik,
a)

it should be startrow<c
b) also before running second for loop makesure startrow<c