program raf105;
uses
graphABC;
var
a: array[1..20,1..2] of integer;
x,y,i:integer;
begin
ClearWindow(clBlack);
randomize;
repeat
if i = 20 then
i:= 0;
i:=i+1;
x:=random(windowwidth);
y:=random(windowheight);
if a[i,1] = 0 then
a[i,1]:= x;
a[i,2]:= y;
end
else
setbrushcolor(clBlack);
circle(a[i,1],a[i,2],4);
end;
sleep(200);
setbrushcolor(clWhite);
circle(x,y,4);
until false;
end.
const
n = 4;
a: array[1..n,1..n] of integer;
i,j,sum: integer;
for i:=1 to n do
writeln;
for j:=1 to n do
a[i,j]:= random(1,9);
if i = j then
sum:= sum + a[i,j];
write(a[i,j]:4,' ');
writeln('Вывод:');
if i <> j then
a[i,j]:= a[i,j] * sum;
program raf105;
uses
graphABC;
var
a: array[1..20,1..2] of integer;
x,y,i:integer;
begin
ClearWindow(clBlack);
randomize;
repeat
if i = 20 then
i:= 0;
i:=i+1;
x:=random(windowwidth);
y:=random(windowheight);
if a[i,1] = 0 then
begin
a[i,1]:= x;
a[i,2]:= y;
end
else
begin
setbrushcolor(clBlack);
circle(a[i,1],a[i,2],4);
a[i,1]:= x;
a[i,2]:= y;
end;
sleep(200);
setbrushcolor(clWhite);
circle(x,y,4);
until false;
end.
PascalABC 3.4.2program raf105;
const
n = 4;
var
a: array[1..n,1..n] of integer;
i,j,sum: integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
a[i,j]:= random(1,9);
if i = j then
sum:= sum + a[i,j];
write(a[i,j]:4,' ');
end;
end;
writeln;
writeln;
writeln('Вывод:');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
if i <> j then
a[i,j]:= a[i,j] * sum;
write(a[i,j]:4,' ');
end;
end;
end.
PascalABC 3.4.2