uses crt;
var
x, m,n,i,j,s:integer;
map: array[1..10,1..10] of boolean;
nil_map,temp:array[0..10,0..10] of integer;
a, derajat:array[1..10] of integer;
fi,fo:text;
procedure isi_nilai(n:integer);
{mengisi nilai kolom matrik sesuai keterhubungan}
begin
for i:= 1 to n do
for j:= 1 to n do
begin
if map[i,j]=true then
begin
nil_map[i,j]:=1;
end
else nil_map[i,j]:=0;
end;
end;
procedure baca_file(var fi:text);
begin
assign(fi,'input.in');
reset(fi);
readln(fi,n);
{m:=0;}
repeat
readln(fi,i,j);
if (i>=0) and (j>=0) then
begin
map[i,j]:=true;
map[j,i]:=true;
{inc(m);}
end;
until (i=0) and (j=0);
end;
procedure hitung(n:integer);
begin
x:=0;
a[1]:=0;
repeat
i:=1+x;
for j:= 1 to n do
begin
a[i]:=a[i]+nil_map[i,j];
end;
derajat[x+1]:=a[i];
writeln('derajat[',x+1,']:',derajat[x+1]);
inc(x);
until x=n;
end;
procedure buat_output(n:integer;var fo:text);
var k:integer;
begin
for k:= 1 to n do
begin
write(fo,'derajat[',k,']=',derajat[k]);
writeln(fo);
end;
end;
begin
baca_file(fi);
close(fi);
assign(fo,'output.out');
rewrite(fo);
isi_nilai(n);
hitung(n);
buat_output(n,fo);
close(fo);
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 Menentukan Derajat Graph
Post a Comment