uses crt;
var
matrix1: array[1..5,1..5] of real ;
matrix2: array[1..5,1..5] of real;
kondisi: Boolean ;
temp,kolom_kunci,baris_kunci:real ;
x1,x2,z,nilaikunci,temp1,temp2,temp3: real ;
i,indexkolomkunci,indexbariskunci,j,indexbariskuncibaru:integer;
begin
clrscr;
matrix1[1,1]:=-5;
matrix1[1,2]:=-1;
matrix1[1,3]:=0;
matrix1[1,4]:=0;
matrix1[1,5]:=0;
matrix1[2,1]:=2;
matrix1[2,2]:=1;
matrix1[2,3]:=1;
matrix1[2,4]:=0;
matrix1[2,5]:=6;
matrix1[3,1]:=1;
matrix1[3,2]:=-1;
matrix1[3,3]:=0;
matrix1[3,4]:=1;
matrix1[3,5]:=0;
kondisi:=False ;
kolom_kunci:=0;
i:=1;
for j := 1 to 4 do
if matrix1[i,j] < kolom_kunci then
begin
kolom_kunci:=matrix1[i,j];
indexkolomkunci:=j;
end;
writeln('indexkolomkunci=',indexkolomkunci);
baris_kunci:=999;
j:=5;
for i := 2 to 3 do
if ((matrix1[i,j] <>0)) then
begin
baris_kunci:=matrix1[i,j];
indexbariskunci:=i;
end;
writeln('indexbariskunci=',indexbariskunci);
if kolom_kunci = 0 then
begin
kondisi:=True;
z:=matrix1[1,5];
x1:=matrix1[2,5];
x2:=matrix1[3,5];
end
else
begin
nilaikunci:=matrix1[indexbariskunci,indexkolomkunci];
writeln('nilaikunci=',nilaikunci);
i:=indexbariskunci;
for j := 1 to 5 do
begin
matrix2[i,j]:=matrix1[i,j]/nilaikunci;
end;
i:=1;
writeln('indexkolomkunci=,indexkolomkunci');
for j := 1 to 5 do
matrix2[i,j]:=matrix1[i,j]-(matrix1[i,indexkolomkunci] * matrix2[indexbariskunci,j]);
baris_kunci:=0;
j:=5;
for i := 2 to 3 do
if matrix1[i,j] <= baris_kunci then
begin
baris_kunci:=matrix1[i,j];
indexbariskuncibaru:=i;
end;
i:=indexbariskuncibaru;
writeln('indexbariskuncibaru',i);
for j:= 1 to 5 do
matrix2[i,j]:=matrix1[i,j]-(matrix1[i,indexkolomkunci]* matrix2[indexbariskunci,j]);
for i:= 1 to 3 do
for j:=1 to 5 do
matrix1[i,j]:=matrix2[i,j];
end;
z:=matrix1[1,5];
x1:=matrix1[2,5];
x2:=matrix1[3,5];
writeln('nilai z=',z);
writeln('nilai x1=',x1);
writeln('nilai x2=',x2);
readln;
end.
skip to main |
skip to sidebar
--
My Clock
Link Situ Kesukaan
Archives
-
▼
2010
(24)
-
▼
January
(18)
- Kumpulan Judul TA Informatika
- Program C++ Hitung Vocal Pada Sebuah String
- Program C++ Graph Rekursif
- Program C++ Menentukan Irisan
- Program C++ Graph Terhubung
- Program Pascal Menentukan Bilangan ASCII
- Program Pascal Menentukan Bilangan ASCII
- Program Pascal Menentukan Derajat Graph
- Program Pascal Pengurutan dengan Selection Sort
- Program Pascal Menentukan Jumlah Bilangan Prima
- Program Pascal Metode Simplex
- GNU Software
- PENGENALAN TCP - IP
- Program Pascal Membuat Polinomial
- Program Pascal MakMin
- Program Pascal Menghitung Mean
- Program Pascal Metnum
- Program Pascal Palindrom
-
▼
January
(18)
About Me
Followers
Pengunjung Online
Shoutmix
Trafik
-
-
Editing by uliantony.co.cc
0 komentar: Program Pascal Metode Simplex
Post a Comment