x := 0; repeat x := x + 0.03; y := f(x); SetPixel(round(300 + 10 * x), round(240 - 10 * f(x)), clGreen); until 300 + 10 * x > 620 end.
с апгрейдом
uses graphabc; const scale = 20;
var i: integer; x, y: real;
function f(x: real): real; begin if x < 0 then f := 0 else f := sqrt(3 * x); end;
begin Window.Init(0, 0, 1000, 1000, clMoneyGreen); Window.CenterOnScreen;
Line(0, Window.Height div 2, Window.Width, Window.Height div 2); Line(Window.Width div 2, 0, Window.Width div 2, Window.Height); TextOut(Window.Width div 2 + 5, 10, 'y=sqrt(3x)');
x := -1; repeat SetPixel(round(Window.Width div 2 + scale * x), round(Window.Height div 2 - scale * f(x)), clRed); x := x + 0.03; until scale * x > Window.Width div 2 end.
var
i: integer;
x, y: real;
function f(x: real): real;
begin
f := sqrt(3 * x);
end;
begin
Line(0, 240, 620, 240);
Line(300, 0, 300, 900);
TextOut(310, 10, 'y=sqrt(3x)');
x := 0;
repeat
x := x + 0.03;
y := f(x);
SetPixel(round(300 + 10 * x), round(240 - 10 * f(x)), clGreen);
until 300 + 10 * x > 620
end.
с апгрейдом
uses graphabc;
const
scale = 20;
var
i: integer;
x, y: real;
function f(x: real): real;
begin
if x < 0 then
f := 0
else
f := sqrt(3 * x);
end;
begin
Window.Init(0, 0, 1000, 1000, clMoneyGreen);
Window.CenterOnScreen;
Line(0, Window.Height div 2, Window.Width, Window.Height div 2);
Line(Window.Width div 2, 0, Window.Width div 2, Window.Height);
TextOut(Window.Width div 2 + 5, 10, 'y=sqrt(3x)');
x := -1;
repeat
SetPixel(round(Window.Width div 2 + scale * x), round(Window.Height div 2 - scale * f(x)), clRed);
x := x + 0.03;
until scale * x > Window.Width div 2
end.
1) program Array16;
var
i:integer; // счетчик в цикле
N:integer;
a: array [1..10] of integer;
begin
writeln('Введите N (N<10)');
readln(N); // ввод размера массива
for i:=1 to N do
begin
write('a[',i,']=');
readln(A[i]); // ручной ввод значений массива
end;
writeln('Результат');
for i:=1 to N do
begin
// вычисление и вывод элементов в указанном порядке
write(' ',a[(i div 2+1)*((i) mod 2)+ n*((i+1)mod 2)-((i div 2)-1)*((i+1) mod 2)]);
end;
end.
2) Var A:array[1..100] of integer;
i,n:byte;
Begin
write('Введите n<=100: ');readln(n);
For i:=1 to n do
Begin
A[i]:=random(31);
write(A[i]:3);
End;
writeln;
For i:=1 to n div 2 do
write(A[i]:3,A[n-i+1]:3);
if n mod 2 <>0 then write(A[n div 2+1]:3);
End.