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.
skip to main |
skip to sidebar
--
Algoritma_pengurutan
mencoba sebuah karya dunia maya
1 komentar
{pengurutan acd dengan nilai maxs}
uses wincrt;
var
i,j,n,imaks,k,temp,maks:integer;
data:array [1..100] of integer;
begin
write('masukkan banyak data:');readln(n);
for i := 1 to n do
begin
write('data',i,'=');readln(data[i]);
end;
for k := n downto 2 do
begin
imaks := 1;
maks:=data[1];
for j := 2 to k do
begin
if data[j] > maks then
imaks := j;
maks:=data[j];
end;
temp:=data[k];
data[k]:=maks;
data[imaks]:= temp;
end;
for i := 1 to n do
begin
writeln(data[i]);
end;
readln;
donewincrt;
end.
uses wincrt;
var
i,j,n,imaks,k,temp,maks:integer;
data:array [1..100] of integer;
begin
write('masukkan banyak data:');readln(n);
for i := 1 to n do
begin
write('data',i,'=');readln(data[i]);
end;
for k := n downto 2 do
begin
imaks := 1;
maks:=data[1];
for j := 2 to k do
begin
if data[j] > maks then
imaks := j;
maks:=data[j];
end;
temp:=data[k];
data[k]:=maks;
data[imaks]:= temp;
end;
for i := 1 to n do
begin
writeln(data[i]);
end;
readln;
donewincrt;
end.
My Clock
Link Situ Kesukaan
Archives
About Me
Followers
Pengunjung Online
Shoutmix
Trafik
-
-
Editing by uliantony.co.cc