Pagini recente » Cod sursa (job #2190535) | Cod sursa (job #2942429) | Cod sursa (job #2190496) | Cod sursa (job #1681236) | Cod sursa (job #1171386)
program p1;
var s,s1:ansistring;
f,g:text;
i,n,m,j,k,u,l:longint;
sol:array[0..10000] of longint;
begin
assign(f,'strmatch.in');reset(F);
assign(g,'strmatch.out');rewrite(G);
readln(f,s);
readln(F,s1);
i:=1; l:=0;
while i<=length(S1) do begin
if s1[i]=s[1] then begin
k:=i; l:=0;
for j:=1 to length(S) do
if (s[j]=s1[k]) and(k<>length(s1))then begin
inc(k);
inc(l);
end;
if l=length(S) then begin
inc(u);
sol[u]:=i-1;
end
end;
inc(i);
end;
writeln(G,u);
for i:=1 to u do write(g,sol[i],' ');
close(F);
close(G);
end.