Var
A:array[1..n]of integer; укажите нужный размер массива
P,i:integer;
Begin
Readln(p);
Readln(n);
For i:=1 to n do
Read(a[i]);
If a[i]>p then begin
Writeln(a[i]);
Break;
End;
End.
Function func32575497(a As Range, p As Double) As Integer
Dim r As Range
Dim i, j As Integer
For Each r In a
i = i + 1
If Fix((1 + Sgn(r - p)) / 2) Then: j = i: Exit For
Next
func32575497 = j
End Function
Excel VBA
Var
A:array[1..n]of integer; укажите нужный размер массива
P,i:integer;
Begin
Readln(p);
Readln(n);
For i:=1 to n do
Read(a[i]);
For i:=1 to n do
If a[i]>p then begin
Writeln(a[i]);
Break;
End;
End.
Function func32575497(a As Range, p As Double) As Integer
Dim r As Range
Dim i, j As Integer
For Each r In a
i = i + 1
If Fix((1 + Sgn(r - p)) / 2) Then: j = i: Exit For
Next
func32575497 = j
End Function
Excel VBA