REVIEW WEBSITE MEDIAKOMEN.COM || WEBSITE DAFTAR JADI BUZZER || PENGHASIL UANG VIA WEBSITE || RECEHAN REVIEW WEBSITE MEDIAKOMEN.COM || WEBSITE DAFTAR JADI BUZZER || PENGHASIL UANG VIA WEBSITE || RECEHAN REVIEW WEBSITE MEDIAKOMEN.COM || WEBSITE DAFTAR JADI BUZZER || PENGHASIL UANG VIA WEBSITE || RECEHAN REVIEW WEBSITE MEDIAKOMEN.COM || WEBSITE DAFTAR JADI BUZZER || PENGHASIL UANG VIA WEBSITE || RECEHAN #REVIEWWEBSITE #penghasiluang #receh Berikut Link Webistenya : https://www.mediakomen.com/ 0:00:00 ▼ EXPAND FOR NAVIGATION ▼ 0:01 CH 0: Opening 0:08 CH 1: Story 0:10 CH 2: Closing
Selection Sort Program Pascal
Selamat malam siang sore pagi sob, kali ini mimin akan berbagi source code pascal nih tentang selection sort, pasti udah pada tahu kan, langsung aja sob pantengin code nya :D.
Program Selection_Sort;
uses crt;
var i,j,k,temp,imaks, n : integer;
A,B,C : array [1..100] of integer;
begin
clrscr;
write('Banyaknya elemen array : '); readln(n);
{input data}
for i := 1 to n do
begin
write('Elemen ke-', i,':'); readln(A[i]);
end;
{Cetak array sebelum pengurutan}
writeln;
write('Sebelum pengurutan : ');
for i := 1 to n do
write(A[i],' ');
writeln; writeln;
writeln('Proses pengurutan seleksi : ');
for i := 1 to n-1 do
begin
imaks := 1;
for j := 2 to n-i+1 do
if A[j] > A[imaks] then
imaks := j;
{tukar A[j] dengan A[imaks]}
temp := A[imaks];
A[imaks] := A[n-i+1];
A[n-i+1] := temp;
writeln;
{cetak array tiap langkah pengurutan}
write('Hasil akhir langka ke-',i,':');
for k := 1 to n do
write(A[k],' ');
end;
{Cetak array setelah pengurutan}
writeln;
write('Hasil pengurutan seleksi : ');
for i := 1 to n do
write(A[i],' ');
writeln;
write('press enter to continue');
readln;
end.
========================================================================
OUTPUT
========================================================================
Nah semoga dapat bermanfaat bagi sobat-sobat semuanya, Salam Syntax_Error.
Komentar
Posting Komentar