Const
key = 3;
var
i: integer;
s: string;
function Encode(s: string; key: integer): string;
var
i: integer;
begin
for i := 1 to Length(s) do
s[i] := chr(ord(s[i]) + key);
Encode := s;
end;
function Decode(s: string; key: integer): string;
var
i: integer;
begin
for i := 1 to Length(s) do
s[i] := chr(ord(s[i]) - key);
Decode := s;
end;
begin
write('Введите строку данных - ');
readln(s);
writeln('Выберите действие');
writeln('1 - Закодировать');
writeln('2 - Раскодировать');
readln(i);
case i of
1: s := Encode(s, key);
2: s := Decode(s, key);
end;
Writeln(s);
end.
Ответ:
Program ship;
Uses crt,graph;
Var gd,gm: integer;
Begin
gd:=detect;
Initgraph(gd,gm,'');
Line(100,300,400,300);
Line(150,380,350,380);
Line(100,300,150,380);
Line(400,300,350,380);
Line(250,300,250,180);
Line(250,180,340,230);
Line(340,230,250,280);
Setfillstyle(9,blue);
Floodfill(160,340,15);
Setfillstyle(3,lightgreen);
Floodfill(270,210,15);
Readkey;
Closegraph;
End.
Объяснение:
640*480 = 307 200пикселей.
307200*3 = 921 600Байт.
921 600Байт*8 =7 372 800Бит
7372800Бит/28800Бит/c=256 секунд
Может, потому что ведь он же знаком с ним и должен знать.
Var
x:real;
n:integer;
begin
Write('Введите x -> ');
Readln(x);
Write('Введите номер действия(1..4) - > ');
readln(n);
case n of
1: Writeln('y = ', x*x);
2: Writeln('y = ', cos(x));
3: Writeln('y = ', sin(x));
4: Writeln('y = ', abs(x));
end;
end.