Цитата:
Сообщение от lisa_a
1) Если в заданный текст входит каждая из букв слова "key" следует напечатать "yes" иначе – "no".
|
Код:
Var
S:String;
b1,b2,b3:boolean;
i:Byte;
Begin
Writeln('Enter the string:');
Readln(S);
b1:=false;
b2:=false;
b3:=false;
For i:=1 to Length(S) do
begin
if S[i]='k' then b1:=true;
if S[i]='e' then b2:=true;
if S[i]='y' then b3:=true;
end;
If b1 and b2 and b3 then Writeln('Yes!') else Writeln('No!');
Readln
End.