Pascal,Compile Error。
查看原帖
Pascal,Compile Error。
303025
zjyqwq楼主2021/5/14 21:19
uses math;
var
t,i:longint;
s:string;
function c1(s:string):longint;
begin
 c1:=0;
 while pos('tokyo',s)>0 do
  begin
   inc(c1);
   delete(s,pos('tokyo',s),5);
  end;
end;
function c2(s:string):longint;
begin
 c2:=0;
 while pos('kyoto',s)>0 do
  begin
   inc(c2);
   delete(s,pos('kyoto',s),5);
  end;
end;
 begin
  readln(t);
  for i:=1 to t do
   begin
    readln(s);
    writeln(max(c1(s),c2(s)));
   end;
 end.

RT.但是洛谷IDE和本地FP都可以通过。

2021/5/14 21:19
加载中...