题目: |
const
SIZE=100;
var
n,i,sum,x:integer;
A:array[1..SIZE]of integer;
begin
readln(n);
fillchar(a,sizeof(a),0);
for i:=1 to n do
begin
read(x);
inc(a[x]);
end;
i:=0;
sum:=0;
while sum<(n div 2 + 1) do
begin
inc(i);
sum:=sum+a[i];
end;
writeln(i);
end.
输入:
11
4 5 6 6 4 3 3 2 3 2 1 输出:3
|