Ну ладно, раз так - пожалуйста:
Код:
VAR
A:ARRAY[1..10] of Real;
b,dif:Real;
n,i_n,n_large:Byte;
i:Integer;
BEGIN
Randomize;
For i:=1 to 10 do
begin
A[i]:=Random*100;
Write(A[i]:7:3);
end;
WriteLn;
Write('b= ');
ReadLn(b);
Write('n= ');
ReadLn(n);
n_large:=0;
For i:=1 to 10 do
if A[i]>b then n_large:=n_large+1;
WriteLn('Number of elements larger then ',b:7:3,' is ',n_large);
dif:=100;
For i:=1 to 10 do
if Abs(A[i]-1.0*n)<dif then
begin
dif:=Abs(A[i]-1.0*n);
i_n:=i;
end;
WriteLn('Close to ',n,' is the element number ',i_n);
ReadLn;
END.