Selasa, 06 Januari 2015

MATRIKS MENGGUNAKAN GAUSS JORDAN MODEL

Contoh 1:
program Project8;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
  matrik:array[1..10,1..10] of integer;
  x,y:integer;
begin
  writeln('NIM  : 114224008');
  writeln('NAMA : AZIZUN NURRACHMAN);
  writeln ('=============================');
  writeln ('TAMPILAN MATRIKS GAUSS JORDAN');
  writeln ('=============================');
  writeln ('');
  for x := 1 to 5 do
  begin
    for y := 1 to 5 do
      begin
        matrik[x,y]:=0;
        if x >= y then matrik[x,y]:=x;
        write(matrik[x,y]:4);
      end;
      writeln;
  end;
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

Contoh 2:
program Project10;
{$APPTYPE CONSOLE}
uses
  SysUtils;
var
  matrik:array[1..10,1..10] of integer;
  x,y:integer;
begin
  writeln ('NIM  : 114224008);
  writeln ('NAMA : AZIZUN NURRACHMAN');
  writeln ('=============================');
  writeln ('TAMPILAN MATRIKS GAUSS JORDAN');
  writeln ('=============================');
  writeln ('');
  for x := 1 to 5 do
  begin
    for y := 1 to 5 do
      begin
        matrik[x,y]:=0;
        if x + y <= 6 then
          write('*':4)
        else
          write('1':4);
      end;
      writeln;
  end;
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

0 komentar:

Posting Komentar