Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const max=99999;
- var a:array[1..max] of integer;
- n,i,j,k:integer;
- begin
- randomize;
- readln(n);
- for i:=1 to n do
- begin
- a[i]:=random(10);
- write(a[i],' ');
- end;
- writeln;
- i:=1;
- while i<=n do
- begin
- j:=i+1;
- while j<=n do
- begin
- if a[j]=a[i] then
- begin
- for k:=j to n-1 do
- a[k]:=a[k+1];
- n:=n-1;
- end
- else j:=j+1;
- end;
- i:=i+1;
- end;
- for i:=1 to n do
- write(a[i],' ');
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement