讨论 / 各位帮忙看看哪里错了,只能过四组数据怎么回事
Anderson 2013-11-02 20:41:58
点我顶贴 收藏 删除
var

i,j,k,n,m,r,sum,l:longint;

s,a,ss:string;

begin

read(s);readln;

read(ss);

n:=length(s);

m:=length(ss);sum:=0;

for i:=m downto 0 do

begin

if (ss[i]=' ')or(i=0) then

if (ss[i+n+1]=' ')or(i+n=m) then

begin

a:=copy(ss,i+1,n);

for l:=1 to n do

begin

a[l]:=lowercase(a[l]);

s[l]:=lowercase(s[l]);

end;

if (a=s) then

begin

inc(sum);

r:=i;

end;

end;

end;

if sum=0 then write('-1')

else

begin

write(sum,' ',r);

end;

end.

查看更多回复
提交回复