Пишем:
Код:
function Test(X, Y, Z: Integer): Boolean;
begin
        Test := ((X > 0) and (Y <= 0) and (Z <= 0))
                or ((X <= 0) and (Y > 0) and (Z <= 0))
                or ((X <= 0) and (Y <= 0) and (Z > 0))
end;
begin
        WriteLn(' 1,  1,  1 --> ', Test( 1,  1,  1));
        WriteLn('-1,  1,  1 --> ', Test(-1,  1,  1));
        WriteLn(' 1, -1,  1 --> ', Test( 1, -1,  1));
        WriteLn('-1, -1,  1 --> ', Test(-1, -1,  1));
        WriteLn(' 1,  1, -1 --> ', Test( 1,  1, -1));
        WriteLn('-1,  1, -1 --> ', Test(-1,  1, -1));
        WriteLn(' 1, -1, -1 --> ', Test( 1, -1, -1));
        WriteLn('-1, -1, -1 --> ', Test(-1, -1, -1))
end.
и получаем:
Код:
 1,  1,  1 --> FALSE
-1,  1,  1 --> FALSE
 1, -1,  1 --> FALSE
-1, -1,  1 --> TRUE
 1,  1, -1 --> FALSE
-1,  1, -1 --> TRUE
 1, -1, -1 --> TRUE
-1, -1, -1 --> FALSE
Что не так?