My output is same line by line . can you check it please . but this is not accepted why?

int n;cin >> n;

int mat[n][n];

for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
        cin >> mat[i][j];
    }
}


for(int i=0;i<n;i++){
    reverse(mat[i],mat[i]+n);
}

for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
        if(j<i) swap(mat[i][j],mat[j][i]);
    }
}
for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
        cout <<  mat[i][j] << " ";
    }
    cout << endl;
}

hello @Tanishq_Gupta
there is some issue with checker ,it is showing wa for every solution.
pls try again after some time.

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.