Pagini recente » Cod sursa (job #1278195) | Cod sursa (job #2581452) | Cod sursa (job #1251271) | Cod sursa (job #2647668) | Cod sursa (job #1098973)
Program Str ;
var a,b:string ; f:text ; i,j:longint ;
c:array[1..2000001] of 1..2000001 ;
function G:boolean ;
var l:longint ; label 1 ;
begin G:=false ;
for l:=2 to length(a) do if a[l]<>b[i+l-1] then goto 1 ;
g:=true ; 1 :
end ;
begin j:=0 ;
assign(f,'strmatch.in') ; reset(f) ; readln(f,a) ; readln(f,b) ; close(f) ;
assign(f,'strmatch.out') ; rewrite(f) ;
for i:=1 to length(b)-length(a)+1 do if a[1]=b[i] then if G then begin inc(j) ;
c[j]:=i-1 ; end ; if j>1000 then j:=1000 ; writeln(f,j) ;
for i:=1 to j do write(f,c[i],' ') ; close(f) ;
end .