题目: |
var
s,s1:string;
i, a, b, k: integer;
begin
readln(s);
s1:='you';
k:=0;
a:=length(s);
b:=length(s1);
for i:=1 to a-b+1 do
if copy(s, i, b)=s1 then k:=k+1;
writeln(k);
end.
输入:It's easy. You get off the bus. Then you cross the road. You take the first road on the left. You walk for five minutes.
输出:1
|