A = [2 1 1; 1 -1 -1; 1 2 1];
b = [3; 0; 0];

A1 = [3 1 1 ; 0 -1 -1;0 2 1 ];
A2 = [2 3 1; 1 0 -1; 1 0 1];
A3 = [2 1 3; 1 -1 0; 1 2 0];

detA=det(A);
disp("det(A)=");
disp(detA);

x = det(A1)/detA;
y = det(A2)/detA;
z = det(A3)/detA;

disp("x=");
disp(x);
disp("y=");
disp(y);
disp("z=");
disp(z);