Sabtu, 25 April 2015

PROGRAM INPUT DATA TAK BERULANG

Program input_takberulang;
uses wincrt;
var
n, i, j,k,m : 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]);
for j:= 1 to i-1  do
Begin
if x[i] = x[j] then
repeat
Write ('Data ke-',i,'= '); readln (x[i]);
until  (x[i] <> x[j]);
for m := 1 to i-1 do
for k:= 1 to i-1 do
if x[i] = x[k] then
repeat
Write ('Data ke-',i,'= '); readln (x[i]);
until  (x[i] <> x[k]);
end;
end;
writeln (' maka data hasil input anda adalah ...');
for i := 1 to n do
writeln (' x[',i,']: ',x[i]);
end.


0 komentar:

Posting Komentar