var a: array [1..5, 1..10] of integer; i, j: integer; p: real;
begin for i := 1 to 5 do begin for j := 1 to 10 do begin a[i, j] := random(50) + 1; write(a[i, j]:3); end; writeln; end; writeln('произведения элементов строк'); for i := 1 to 5 do begin p := 1; for j := 1 to 10 do p := p * a[i, j]; writeln(p:25:0); end; end.
1)
var
a:array [1..5,1..10] of integer;
i,j,p:integer;
begin
for i:=1 to 5 do
begin
for j:=1 to 10 do
begin
a[i,j]:=random(50)+1;
write(a[i,j]:3);
end;
writeln;
end;
writeln('меняем 1 и последнюю строки');
for j:=1 to 10 do
begin
p:=a[1,j];
a[1,j]:=a[5,j];
a[5,j]:=p;
end;
for i:=1 to 5 do
begin
for j:=1 to 10 do
write(a[i,j]:3);
writeln;
end;
end.
2)
var
a: array [1..5, 1..10] of integer;
i, j: integer;
p: real;
begin
for i := 1 to 5 do
begin
for j := 1 to 10 do
begin
a[i, j] := random(50) + 1;
write(a[i, j]:3);
end;
writeln;
end;
writeln('произведения элементов строк');
for i := 1 to 5 do
begin
p := 1;
for j := 1 to 10 do
p := p * a[i, j];
writeln(p:25:0);
end;
end.
1)
var a,b,c,d:real;
begin
read(a,b);
c:=(a+b)/2;
d:=2*a*b;
if a>b then begin
a:=d;
b:=c;
end;
if a<b then begin
a:=c;
b:=d;
end;
writeln(a,' ',b);
end.
2)
var a,b:integer;
begin
read(a,b);
if (a<1) or (a>31) then writeln(' день введен неправильно');
if (b<1) or (b>12) then writeln(' месяц введен неправильно');
end.
3)
var a,b,c:real;
begin
read(a,b,c);
if (a>b)and(a>c)then writeln(a);
if (b>a)and(b>c)then writeln(b);
if (c>b)and(c>a)then writeln(c);
end.