var a: array [1..100,1..100] of longint ;i, j ,d, n,m,k: longint;beginread(n,m); for i:=1 to n do for j:= 1 to m doread(a[i,j]); j:=0; for i:=1 to n do begin j:=j+1; d:=0; while d<2 do if a[i,j]<0 then begin k:=k+1; d:= 3; end; end;
if k>(m/2) then begin for i:= 1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*10 ; end else begin for i:=1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*a[i,j] ;end; for i:=1 to n dobegin for j:= 1 to m dowrite(a[i,j],' ');end;end.
for i:=1 to n do for j:= 1 to m doread(a[i,j]);
j:=0;
for i:=1 to n do begin j:=j+1; d:=0; while d<2 do if a[i,j]<0 then begin k:=k+1; d:= 3; end; end;
if k>(m/2) then begin for i:= 1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*10 ;
end
else
begin for i:=1 to n do for j:= 1 to m do if a[i,j]<0 then a[i,j]:=a[i,j]*a[i,j] ;end;
for i:=1 to n dobegin for j:= 1 to m dowrite(a[i,j],' ');end;end.
x = 28.35;
var
g : Real;
begin
Write('Введите кол-во граммов: ');
ReadLn(g);
Writeln(g:0:3, ' грамм = ', g/x:0:3, ' унций.');
Readln;
end.
2:
var
a, b, c : Integer;
m : Real;
begin
Write('Введите сторону a: ');
ReadLn(a);
Write('Введите сторону b: ');
ReadLn(b);
Write('Введите сторону c: ');
ReadLn(c);
m := sqrt(2*sqr(b) + 2*sqr(c) - sqr(a))/2;
Writeln('Медиана к стороне a = ', m:0:3);
m := sqrt(2*sqr(a) + 2*sqr(c) - sqr(b))/2;
Writeln('Медиана к стороне b = ', m:0:3);
m := sqrt(2*sqr(a) + 2*sqr(b) - sqr(c))/2;
Writeln('Медиана к стороне с = ', m:0:3);
Readln;
end.