Uses wincrt;
Var
n, i, j:integer;
x:array [1..100] of integer;
Begin
Write ('Masukkan banyak data ='); readln (n);
Writeln;
for i:=1 to n do
Begin
Write ('Data ke-',i,'= '); readln (x[i]);
End;
Writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n-1 do
for j:=i+1 to n do
Begin
if x[i]=x[j] then
x[j]:=x[j+1]
End;
for i:=1 to n do
if x[i]=x[i+1] then
Writeln
else
begin
Writeln ('Data ke-',i,'= ',x[i]);
end;
End.
Tidak ada komentar:
Posting Komentar