дешифровки: 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.
var mas1, mas2: array[0..9] of integer; t, k, i, j: integer; begin readln(t); readln(k); for j := 0 to 1 do begin if (j = 1) then writeln(); for i := 0 to 9 do begin if(j = 0) then begin mas1[i] := random(100); write(mas1[i], ' '); if mas1[i] > t Then mas1[i] := mas1[i] + 4; end else begin mas2[i] := random(100); write(mas2[i], ' '); if mas2[i] > 10 * K Then mas2[i] := mas2[i] + K; end; end; for i := 0 to 9 do if (j = 0) then write(mas1[i]) else write(mas2[i]); writeln(); end; readln(); 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.
begin
readln(t);
readln(k);
for j := 0 to 1 do begin
if (j = 1) then writeln();
for i := 0 to 9 do begin
if(j = 0) then begin
mas1[i] := random(100);
write(mas1[i], ' ');
if mas1[i] > t Then mas1[i] := mas1[i] + 4;
end
else
begin
mas2[i] := random(100);
write(mas2[i], ' ');
if mas2[i] > 10 * K Then
mas2[i] := mas2[i] + K;
end;
end;
for i := 0 to 9 do
if (j = 0) then
write(mas1[i])
else
write(mas2[i]);
writeln();
end;
readln();
end.
))