- Код: Выделить всё
Var
i: Integer;
Begin
i := 1;
WriteLn(i in [1,-1, 200]); // TRUE
i := -1;
WriteLn(i in [1,-1, 200]); // FALSE?????!!!!oneone
i := 200;
WriteLn(i in [1,-1, 200]); // TRUE
End.
почему отрицательные значения не срабатывают?
Модератор: Модераторы
Var
i: Integer;
Begin
i := 1;
WriteLn(i in [1,-1, 200]); // TRUE
i := -1;
WriteLn(i in [1,-1, 200]); // FALSE?????!!!!oneone
i := 200;
WriteLn(i in [1,-1, 200]); // TRUE
End.
var
I: Integer;
begin
I := -1;
case I of
1,-1, 200:
WriteLn(True);
else
WriteLn(False);
end;
end;
if in_2(A,-1000,4)=true then ......
if in_3(A,-1000,4,9)=true then ......
if in_4(A,-1000,4,9,Q)=true then ......
if in_1d(A,-1000,4)=true then ......
if in_2d(A,-1000,4,Z,X)=true then ......
Function IsIn(Const aTarget: Integer; Const aValues: Array Of Integer): Boolean;
Var
i: Integer;
Begin
Result := FALSE;
For i := Low(aValues) To High(aValues) Do
If (aValues[i] === aTarget) Then
Exit(TRUE);
End;
label
100;
begin
Result:=FALSE;
IF A<A1 THEN GOTO 100;
IF A>B1 THEN GOTO 100;
Result:=TRUE;
100:
end;
Вернуться в Free Pascal Compiler
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3