- 问答
- 2014-10-29 15:19:05 @
var
a:array[1..1000] of integer;
m,c,d,b:integer;
begin
read(b);
for m:=1 to b do read (a[m]);
for m:=1 to b-1 do
for c:=m+1 to b do
if a[m]>a[c] then
begin
d:=a[m];a[m]:=a[c];a[c]:=d;
end;
for m:=2 to b do
if a[m]=a[m-1] then a[m-1]:=0;
for m:=1 to b-1 do
for c:=m+1 to b do
if a[m]>a[c] then
begin
d:=a[m],a[m]:=a[c],a[c]=d;
end;
d:=o;
for m:=1 to b do;
if a[m]<>0 then inc(d);
writeln (d);
for m :=b-d+1 to b do write(a[m],' ');
end.
0 条评论
目前还没有评论...