Pages

Selasa, 21 Juni 2011

SisTEmM PerSamaAAn LiinieEaaRR

-->  Algoritma Sistem Persamaan Linier
{Algoritma Untuk menyelesaikan Sistem persamaan Linier}
Deklarasi       
n,tamping        : interger
A[0…9][0…9]            : array 2dimensi interger
B[0…9]]          : array 1 dimensi interger
X[0…9]           : array 1 dimensi interger
Deskripsi
read ( n )
for i <-- 0 to n do
    for j <-- 0 to n do
           read (A[i][j])
end for
end for
for i <-- 0 to n do
read (B[i])
end for
for i <-- 1 to n do
      for j <-- 0 to n do
            A[i][j]=A[i][j]+((-1)*A[i-1][j])
            B[i] = b[i] + ((-1)*b[0])
end for
end for
for i <-- n-1 down to 0 do
   x[i] <-- b[i]
end for
forn i <-- 0 to n do
A[0][i] = A[0][i]*b[i]
end for
tamping <-- 0
for i <-- 0 to n do
tamping = tamping+(A[0][i]*x[i])
end for
x[0]=(b[0]-tampung) div A[0][0]
for i <-- 0 to n do
end for
write ( x[i] )

0 komentar:

Posting Komentar