--

tugas kuliah algoritma_pencarian

Monday, March 30, 2009 mencoba sebuah karya dunia maya
uses wincrt;
type id_mhs= record
nim,nama:string;
end;
var
id : array [1..10] of id_mhs;
i,j,a,n:integer;
temp_cari:string;

begin
i:=0;
repeat
inc(i);
write('masukkan banyak data:');readln(n);
until (i >=3) or (n > 1);
for j := 1 to n do
begin
write('nim:');readln(id[j].nim);
write('nama:');readln(id[j].nama);
end;
clrscr;
begin
write('masukkan nim:');readln(temp_cari);
A:= 0;
repeat
inc(a);
until (i >= n) or (id[i].nim = temp_cari);
if (id[i].nim = temp_cari) then
writeln('nama:',id[i].nama)
else
writeln('tidak ditemukan');
readln;
donewincrt;
end;

end.

2 komentar: tugas kuliah algoritma_pencarian

Anonymous said...
April 14, 2009 at 12:44 AM
This comment has been removed by a blog administrator.
Anonymous said...
April 14, 2009 at 12:44 AM
This comment has been removed by a blog administrator.

Post a Comment