Поделитесь своими знаниями, ответьте на вопрос:
On a standard chess board with (8 * 8) squares, a chess piece starts to move from the lower left corner, which we shall label as square (1 * 1 This piece is allowed to move only upwards or rightwards. At any point, the piece cannot move downwards, leftwards or diagonally, e.g., from square (2 * 3), the piece may go towards (3 * 3) or (2 * 4) but not any other direction. If this piece continues to
l,a,b:integer;
s: string;
begin
write('Введите строку: ');
readln(s);
l:=length(s);
writeln('L=',l);
if l>6 then
begin
a:=pos('(',s);
b:=pos(')',s);
if (a>0) and (b>0) then writeln(copy(s,a+1,b-a-1));
if (a=0) and (b>0) then writeln('Скобка не открыта');
if (a>0) and (b=0) then writeln('Скобка не закрыта');
if (a=0) and (b=0) then writeln('Текста в скобках нет');
end;
end.
var
n,i,k:integer;
s,t: string;
begin
write('Введите строку: ');
readln(s);
t:=s;
repeat
i:=pos(' ',t);
delete(t,1,i);
until i=0;
k:=length(t);
for i:=1 to k do
if t[i]='k' then n:=n+1;
writeln('Кол-во букв k: ',n);
end.