помогите переделать под графическое управление
Код:
var
a: array of real;
i, n: integer;
T: real;
begin
randomize;
write('n='); readln(n);
SetLength(a, n);
for i := 0 to n - 1 do
begin
a[i] := random * 100;
write(a[i]:8:2);
end;
writeln;
writeln('Измененный массив:');
t := a[0];
for i := 1 to n - 2 do
begin
if (a[i] > T) and (a[i] > a[i + 1]) then
begin
t := a[i]; a[i] := 0;
end
else t := a[i];
end;
for i := 0 to n - 1 do write(a[i]:8:2);
writeln;
end.
a: array of real;
i, n: integer;
T: real;
begin
randomize;
write('n='); readln(n);
SetLength(a, n);
for i := 0 to n - 1 do
begin
a[i] := random * 100;
write(a[i]:8:2);
end;
writeln;
writeln('Измененный массив:');
t := a[0];
for i := 1 to n - 2 do
begin
if (a[i] > T) and (a[i] > a[i + 1]) then
begin
t := a[i]; a[i] := 0;
end
else t := a[i];
end;
for i := 0 to n - 1 do write(a[i]:8:2);
writeln;
end.