#include <iostream>
using namespace std;
int main() {
double **A = new double *[3];
double x = 0;
double y = 0;
double z = 0;
float tmp_x, tmp_y, tmp_z;
for(int i = 0; i < 3; i++){
A[i] = new double [3];
}
A[0][0] = 5;
A[0][1] = -2;
A[0][2] = 3;
A[1][0] = 2;
A[1][1] = 4;
A[1][2] = 2;
A[2][0] = 2;
A[2][1] = -1;
A[2][2] = -4;
double *B = new double[3];
B[0] = 10;
B[1] = 0;
B[2] = 0;
for(int j = 0; j < 10; j++){
tmp_x = (B[0] - A[0][1] * y - A[0][2] * z)/A[0][0];
tmp_y = (B[1] - A[1][0] * x - A[1][2] * z)/A[1][1];
tmp_z = (B[2] - A[2][0] * x - A[2][1] * y)/A[2][2];
x = tmp_x;
y = tmp_y;
z = tmp_z;
cout << "X = " << x << " Y = " << y << " Z: " << z << endl;
}
cout << A[0][0] * x + A[0][1] * y + A[0][2] * z << endl;
cout << A[1][0] * x + A[1][1] * y + A[1][2] * z << endl;
cout << A[2][0] * x + A[2][1] * y + A[2][2] * z << endl;
system("PAUSE");
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}