- 统计单词个数
- 2010-04-11 13:34:18 @
答案:193 输出:196
大牛看看哦
var
f:array[0..200]of boolean;
i,j,k,p,n,m,ans,l:longint;
s:array[0..10]of string;
st,s1:string;
begin
readln(p,n);
fillchar(f,sizeof(f),false);
st:=''; ans:=0;
for i:=1 to p do
begin readln(s1); st:=st+s1; end;
readln(m);
for i:=1 to m do readln(s[i]);
k:=length(st);
for i:=1 to m do
begin
l:=length(s[i]);
for j:=k downto 1 do
if(copy(st,j,l)=s[i])and(not f[j])then
f[j]:=true;
end;
for i:=1 to length(st) do
if f[i] then inc(ans);
writeln(ans);
end.
0 条评论
目前还没有评论...