2017.6.4测试 题三 字符串

var
 s:ansistring;
 len,i,t,ans:longint;
begin
 readln(s);
 len:=length(s);
 for i:=1 to len do
  begin
   t:=pos('bear',copy(s,i,len-i+1));//找子序列中'bear'出现的位置
   if t>0 then inc(ans,len-i-t-1);//累加
  end;
 writeln(ans);
end.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-05-02
  • 2021-09-16
猜你喜欢
  • 2021-08-30
  • 2021-05-04
  • 2021-11-11
  • 2021-06-13
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案