Matrix is not printing

My code matrix is not printing
#include
#include
using namespace std;
bool placed(int n,int mat[][100],int i,int j,int num){
for(int x=0;x<n;x++){
if(mat[x][j]==num || mat[i][x]==num){
return false;
}
}
int rn=sqrt(n);
int sx=(i/rn)*rn;
int sy=(j/rn)*rn;
for(int x=sx;x<sx+rn;x++){
for(int y=sy;x<sy+rn;y++){
if(mat[x][y]==num){
return false;
}
}
}
return true;
}
bool solve(int n,int mat[][100],int i,int j){
if(i==n){
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
cout<<mat[i][j]<<" ";

}
}
			return true;
		}
	if(j==n){
		return solve(n,mat,i+1,0);
	}
	if(mat[i][j]!=0){
		return solve(n,mat,i,j+1);
	}
	for(int num=1;num<=n;num++){
		if(placed(n,mat,i,j,num)){
			mat[i][j]=num;
			{
				bool solved=solve(n,mat,i,j+1);
				{
					if (solved==true){
						return true;
					}
				}
			}
		}
	}
mat[i][j]=0;
return false;

}
int main() {
int n;
cin>>n;
int mat[100][100];
for (int i=0;i<n;i++){
for (int j=0;j<n;j++){
cin>>mat[i][j];
}
}
solve(n,mat,0,0);
return 0;
}

check this code

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.