дешифровки: Const sh = '_.,'; Var St : String; i : Integer; Function DeCode(S : String; Tabl : String; k : Integer) : String; Var j,n : Integer; Begin For j:=1 to Length(S) do Begin n:=Pos(S[j],sh); If n>0 then Begin n:=n+k; While n>Length(sh) do n:=n-Length(sh); While n<=0 do n:=n+Length(sh); S[j]:=sh[n]; end end; DeCode:=S; end; Begin St:='ЗЫФЙГФШРЦ . ШД'; Writeln(Decode(St,sh,-6)); //For i:=-10 to 10 do Writeln(Decode(St,sh,i)); end.
дешифровки:
Const sh = '_.,';
Var
St : String;
i : Integer;
Function DeCode(S : String; Tabl : String; k : Integer) : String;
Var j,n : Integer;
Begin
For j:=1 to Length(S) do
Begin
n:=Pos(S[j],sh);
If n>0 then
Begin
n:=n+k;
While n>Length(sh) do n:=n-Length(sh);
While n<=0 do n:=n+Length(sh);
S[j]:=sh[n];
end
end;
DeCode:=S;
end;
Begin
St:='ЗЫФЙГФШРЦ . ШД';
Writeln(Decode(St,sh,-6));
//For i:=-10 to 10 do Writeln(Decode(St,sh,i));
end.
const
n = 3;
m = 4;
var
matrix: array[1..n, 1..m] of integer;
max, max_i, max_j, i, j: integer;
sum: integer;
begin
writeln('введите массив ',n, '*', m, ' элементов: ');
for i : = 1 to n do
for j : = 1 to m do
read(matrix[i,j]);
max : = matrix[1,1];
for i : = 1 to n do
for j : = 1 to m do
if (max < matrix[i,j]) then
begin
max : = matrix[i,j];
max_i : = i;
max_j : = j;
end;
sum : = 0;
for i : = 1 to n do
sum : = sum + matrix[i, max_j];
for j : = 1 to m do
sum : = sum + matrix[max_i, j];
matrix[max_i, max_j] : = sum;
writeln('получившийся массив: ');
for i : = 1 to n do
begin
for j : = 1 to m do
write(matrix[i,j], ' ');
writeln();
end;
end.
пример:
введите массив 3*4 элементов:
1 2 3 4
55 6 7 8
9 10 11 12
получившийся массив:
1 2 3 4
141 6 7 8
9 10 11 12