Определите значение переменной с после выполнения следующего фрагмента программы. ответ запишите в виде целого числа. a = 30 b = 6 a = a / 2 * b if a > b: c = a - 3 * b else: c = a + 3 * b
procedure MatrA(var a: mass); var i, j: integer; begin for i := 1 to n do for j := 1 to m do begin writeln('a[', i, ',', j, ']: '); readln(a[i, j]) end end;
procedure MatrB(var b: mass); var i, j: integer; begin for i := 1 to n1 do for j := 1 to m1 do begin writeln('b[', i, ',', j, ']: '); readln(b[i, j]) end end;
procedure Sum(a, b: mass; var c: mass); var i, j: integer; begin for i := 1 to n do for j := 1 to m do c[i, j] := a[i, j] + b[i, j]; end;
begin writeln('Введите n,m матрицы A'); readln(n, m); MatrA(a); writeln('Введите n,m матрицы B'); readln(n1, m1); MatrB(b); if (n1 <> n) and (m1 <> m) then writeln('Матрицы сложить нельзя') else begin Sum(a, b, c); writeln('A+B'); for i := 1 to n do begin for j := 1 to m do write(c[i, j]:1:3, ' '); writeln end end; readln; end.
ответ:
uses graphabc;
var xx,yy,u: integer;
procedure growl(x,y,r: integer);
var i: byte;
begin
for i: =1 to r do
begin
circle(x,y,i);
sleep(5);
end;
end;
procedure growr(x,y: integer);
var i: byte;
begin
for i: =1 to 20 do
begin
ellipse(x-5,y-(i),x-(i*3),y+(i));
ellipse(x+5,y-(i),x+(i*3),y+(i));
ellipse(x-(i),y-5,x+(i),y-(i*3));
ellipse(x-(i),y+5,x+(i),y+(i*3));
sleep(3);
end;
end;
procedure fall;
var r,prer,i: byte;
x,y: integer;
begin
for i: =1 to 10 do
begin
x: =random(160)-80+windowwidth div 2;
prer: =0;
r: =random(10)+10;
for y: =80+windowheight div 2 to windowheight+30 do
begin
setpencolor(clwhite);
circle(x,y-1,prer);
setpencolor(clblack);
circle(x,y,r);
prer: =r;
sleep(3);
end;
end;
end;
procedure growd (x,y: integer);
var i: byte;
begin
for i: =20 downto 5 do
begin
clearwindow;
setbrushcolor(clgreen);
ellipse(x-5,y-(20),x-(60),y+(20));
ellipse(x+5,y-(20),x+(60),y+(20));
ellipse(x-(20),y-5,x+(20),y-(60));
ellipse(x-(20),y+5,x+(20),y+(60));
setbrushcolor(rgb(255,255-((20-i)*10),255-((20-i)*;
circle(x-i,y-i,i);
circle(x+i,y-i,i);
circle(x+i,y+i,i);
circle(x-i,y+i,i);
sleep(5);
end;
end;
var j: integer;
begin
repeat
setbrushcolor(clgreen);
growr(windowwidth div 2,windowheight div 2);
setbrushcolor(clwhite);
for j: =1 to 360 do
if j mod 10=0 then
begin
xx: =round(windowwidth div 2+20*cos(pi*(u+(j*10))/180));
yy: =round(windowheight div 2+20*sin(pi*(u+(j*10))/180));
growl(xx,-j) div 10));
end;
sleep(100);
fall;
growd (windowwidth div 2,windowheight div 2);
sleep(100);
until false;
end.
объяснение:
mass = array[1..10, 1..10] of real;
var
a, b, c: mass;
n, m, i, j, n1, m1: integer;
procedure MatrA(var a: mass);
var
i, j: integer;
begin
for i := 1 to n do
for j := 1 to m do
begin
writeln('a[', i, ',', j, ']: ');
readln(a[i, j])
end
end;
procedure MatrB(var b: mass);
var
i, j: integer;
begin
for i := 1 to n1 do
for j := 1 to m1 do
begin
writeln('b[', i, ',', j, ']: ');
readln(b[i, j])
end
end;
procedure Sum(a, b: mass; var c: mass);
var
i, j: integer;
begin
for i := 1 to n do
for j := 1 to m do
c[i, j] := a[i, j] + b[i, j];
end;
begin
writeln('Введите n,m матрицы A');
readln(n, m);
MatrA(a);
writeln('Введите n,m матрицы B');
readln(n1, m1);
MatrB(b);
if (n1 <> n) and (m1 <> m) then
writeln('Матрицы сложить нельзя')
else begin
Sum(a, b, c);
writeln('A+B');
for i := 1 to n do
begin
for j := 1 to m do
write(c[i, j]:1:3, ' ');
writeln
end
end;
readln;
end.