You are on page 1of 1

Program System;

label rep,nextj;
const
A:array[1..4,1..4] of real=
(( -2, 0, 6, -4),
( 4, -8, -2, 10),
( 0, -9, -9, 5),
( -5, 7, 3, 4));
B:array[1..4] of real=
(( 68),
( -78),
( -128),
( 27));
n=1;
E=0.0001;
var x:array[1..n] of real;
y:array[1..n] of real;
i,j:integer;
s:real;
begin
for i:= 1 to n do
x[i]:=B[i]/A[i,i];
rep:
for i:= 1 to n do
y[i]:=x[i];
for i:= 1 to n do
begin
s:=0;
for j:= 1 to n do
begin
if j=i then goto nextj
else
s:=s+A[i,j]*y[j];
nextj:
end;
x[i]:=(B[i]-s)/A[i,i];
end;
for i:= 1 to n do
if abs(x[i]-y[i])>=E then goto rep;
for i:= 1 to n do
writeln(x[i]:9:5);
end.

You might also like