请帮忙看一下普及组的第一题这样解行不行?
var
i,j,k,p,t,n:integer;
a:array[1..100] of integer;
input,output:text;
begin
assign(input,'D:\random.in');
reset(input);
readln(input,n);
for i:=1 to n do read(input,a); readln;
close(input);
//writeln('input n:'); readln(n);
//writeln('input imformation:');
//for i:=1 to n do read(a);
t:=n;
for i:=1 to n do
for j:=1 to t do
if j<>i then
begin
if a=a[j] then
begin
for k:=j+1 to t do
a[k-1]:=a[k];
a[t]:=0;
dec(t);
end;
end;
for i:=1 to t-1 do
for j:=i+1 to t do
if a>a[j] then
begin
p:=a;
a:=a[j];
a[j]:=p ;
end;
assign(output,'D:\random.out');
rewrite(output);
writeln(output,t);
for i:=1 to t do write(output,a,' ');
close(output);
readln;
end.