Определить,верно ли что во введенной строке встречаются все буквы из слова <> — Pascal(Паскаль)

Program step;
Uses crt;
Var a: string; i,k: byte; 
Begin
i:=1;
Clrscr;
Write('Введите строку: ');
Readln(a);
While (a[i]<>'s') and (i<>length(a)) do
Inc(i);
If a[i]='s' then Inc(k);
i:=1;
While (a[i]<>'t') and (i<>length(a)) do
Inc(i);
If a[i]='t' then Inc(k);
i:=1;
While (a[i]<>'e') and (i<>length(a)) do
Inc(i);
If a[i]='e' then Inc(k);
i:=1;
While (a[i]<>'p') and (i<>length(a)) do
Inc(i);
If a[i]='p' then Inc(k);
If k=4 then Writeln('Действительно, все буквы слова "step" встречаются в строке')
else Writeln('В строке не встречаются или встречаются не все буквы слова "step"');
End.

Leave a Comment

+ 31 = 33