Var a,b,h,r:real; i:integer; begin write('a, b, h: '); readln(a,b,h); for i:=0 to round((b-a)/h) do begin r:=a+i*h; writeln(r:4:1,pi*r*r:8:3); end; end.
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.
begin
write('a, b, h: ');
readln(a,b,h);
for i:=0 to round((b-a)/h) do
begin
r:=a+i*h;
writeln(r:4:1,pi*r*r:8:3);
end;
end.
Пример:
a, b, h: 2 3 0.2
2.0 12.566
2.2 15.205
2.4 18.096
2.6 21.237
2.8 24.630
3.0 28.274