program P1;
uses
crt;
var
mas : array[1..20] of integer;
i,j,k : integer;
tmp : string;
begin
clrscr;
writeln('Start array: ');
for i := 1 to 20 do
begin
mas[i] := random(100);
write(mas[i],' ');
end;
for i := 1 to 20 do
begin
if mas[i] mod 2 = 0 then
mas[i] := 0;
end;
for i := 1 to 20 do
begin
if mas[i] = 0 then
begin
for j := 20 downto i do
if mas[j] <> 0 then
begin
k := mas[j];
mas[j] := mas[i];
mas[i] := k;
end;
end;
end;
writeln('');
writeln('Result array: ');
for i := 1 to 20 do
write(mas[i],' ');
readln(tmp);
read(tmp);
end.
Составные: крылья, двигатель,кабина
действия: летают, могут перевозить различные грузы
Uses
graphABC;
const
W = 800;
H = 500;
function F(x: real): real;
begin
F := cos(x * x);
end;
var
x0, y0, x, y, xLeft, yLeft, xRight, yRight, n: integer;
a, b, fmin, fmax, x1, y1, mx, my, dx, dy, num: real;
i: byte;
s: string;
begin
SetWindowSize(W, H);
xLeft := 50;
yLeft := 50;
xRight := W - 50;
yRight := H - 50;
a := -2;b := 6;dx := 0.5;
fmin := -10;fmax := 20;dy := 2;
mx := (xRight - xLeft) / (b - a);
my := (yRight - yLeft) / (fmax - fmin);
x0 := trunc(abs(a) * mx) + xLeft;
y0 := yRight - trunc(abs(fmin) * my);
line(xLeft, y0, xRight + 10, y0);
line(x0, yLeft - 10, x0, yRight);
SetFontSize(12);
SetFontColor(clBlue);
TextOut(xRight + 20, y0 - 15, 'X');
TextOut(x0 - 10, yLeft - 30, 'Y');
SetFontSize(8);
SetFontColor(clRed);
n := round((b - a) / dx) + 1;
for i := 1 to n do
begin
num := a + (i - 1) * dx;
x := xLeft + trunc(mx * (num - a));
Line(x, y0 - 3, x, y0 + 3);
str(Num:0:1, s);
if abs(num) > 1E-15 then
TextOut(x - TextWidth(s) div 2, y0 + 10, s)
end;
n := round((fmax - fmin) / dy) + 1;
for i := 1 to n do
begin
num := fMin + (i - 1) * dy;
y := yRight - trunc(my * (num - fmin));
Line(x0 - 3, y, x0 + 3, y);
str(num:0:0, s);
if abs(num) > 1E-15 then
TextOut(x0 + 7, y - TextHeight(s) div 2, s)
end;
TextOut(x0 - 10, y0 + 10, '0');
x1 := a;
while x1 <= b do
begin
y1 := F(x1);
x := x0 + round(x1 * mx);
y := y0 - round(y1 * my);
if (y >= yLeft) and (y <= yRight) then SetPixel(x, y, clGreen);
x1 := x1 + 0.001
end
end.
Program qq;
uses crt;
var x, y: real;
begin
readln (x, y);
if (x*y)<0 then //проверка четверти, в к-й находится точка
if (x*x+y*y)<=1 then // где x^2+y^2=r^2 - ур-е окружности. точка попадает в круг радиусом 1, если радиус окр-ти на которой она лежит, меньше 1
writeln ('попадает')
else
writeln ('не попадает')
else
writeln ('не попадает');
<span>end.</span>