procedure SimulateKeyDown(Key: Byte);
begin
keybd_event(Key, 0, 0, 0);
end;
procedure SimulateKeyUp(Key: Byte);
begin
keybd_event(Key, 0, KEYEVENTF_KEYUP, 0);
end;
procedure SimulateKeystroke(Key: Byte; Extra: DWORD);
begin
keybd_event(Key, extra, 0, 0);
keybd_event(Key, extra, KEYEVENTF_KEYUP, 0);
end;
KEYEVENTF_KEYUP (0x0002)
for var i := 0 to num - 1 do
for var i := 0 to Pred(num) do
for var i := Low(a) to High(a) do
for var i in a do
var Items := RandomRange(10);
print(Items);
TArrayHelp.Sort(Items);
print(Items);
[0, 3, 86, 20, 27, 67, 31, 16, 37, 42]
[0, 3, 16, 20, 27, 31, 37, 42, 67, 86]
uses Math;
begin
var a, b, c, x: integer;
write('Введите A: '); readln(a);
write('Введите B: '); readln(b);
write('Введите C: '); readln(c);
write('Введите X: '); readln(x);
var y: Extended;
if x < b then
y := log10(abs(a + x)) * cos(abs(Power(x, 3)))
else if (b <= x) and (x <= c) then
y := Exp(1.2) - sqrt(abs(a + x))
else if x > c then
y := (Power(sqrt(abs(a + x)), 1 / 3)) / (a - x);
writeln(y);
end.
type
TArray = array of integer;
function IsPrime(const Value: integer): Boolean;
var
N: integer;
begin
for N := 2 to Value - 1 do
if Value mod N = 0 then
Exit(False);
Result := True;
end;
function PrimeMin(const A: TArray): Integer;
var
i: Integer;
begin
Result := -1;
for i := 0 to High(A) do
if IsPrime(A[i]) then
if (Result = -1) or (Result > A[i]) then
Result := A[i];
end;
function FillRandom(Count: Integer): TArray;
var
i: Integer;
begin
Randomize;
SetLength(Result, Count);
for i := 0 to Count - 1 do
begin
Result[i] := Random(1000 - 2) + 2;
write(Result[i]: 4);
end;
writeln;
end;
var
Count: Integer;
Items: TArray;
begin
Write('Введите размер массива: ');
Read(Count);
Write('Массив: ');
Items := FillRandom(Count);
Write('Мин. простое: ', PrimeMin(Items));
Readln;
Readln;
end.