The last fragment remains at the iteration stage:
double A [2][3] = {{ -5, -1, -4}, { -4, 4, -5}}; //матрица с коэффициентами при двух неизвестных double epsilon = 0.001; double x[3], y[3]; // массивы для значений x и y x[0] = 0, y[0] = 0; i = 0; do { x[i + 1] = (A[i][i + 2] - A[i][i + 1] * y[i]) / A[i][i]; y[i + 1] = (A[i + 1][i + 2] - A[i + 1][i] * x[i + 1]) / A[i + 1][i + 1]; cout << "Решение на " << i << "-ой " << "итерации - " << "x = " << round(x[i + 1] * 10000) / 10000 << ", y =" << round( y[i + 1] * 10000) / 10000 << "\n"; i++; } while (abs(x[i + 1]) < epsilon && i < 3); The values on the first iteration correctly calculates x [1] = -0.8, y [1] = -2.05, and the subsequent iterations displays with an error. I understand that you need to correctly assign the previous value of x and y as follows.
i==1you refer to an element, for example,A[2][3]- well, and where is it with you? And withi==2everything is even worse ... And all this in no way corresponds to the stated method. - Harry