不是VIP会员,不能显示答案

题目解答

题目:
const
size = 10;
var
i, j, cnt, n, m : integer;
data : array[1..size] of integer;
begin
readln(n, m);
for i := 1 to n do
read(data[i]);
for i := 1 to n do
begin
cnt := 0;
for j := 1 to n do
if (data[i] < data[j]) or ((data[j] = data[i]) and (j < i))
then inc(cnt);
if cnt = m
then writeln(data[i]);
end;
end.
输入
5 2
96 -8 0 16 87
输出:16
考点:
分析:
解答:
评论:
老师: