Pagini recente » Cod sursa (job #665393) | Cod sursa (job #1901122) | Cod sursa (job #529290) | Cod sursa (job #2688780) | Cod sursa (job #1423088)
var a,b:string;
i,j:longint;
c:boolean;
v:array[0..1000000] of longint;
begin
assign(input,'strmatch.in');
assign(output,'strmatch.out');
reset(input);
rewrite(output);
// assign(input,'input.in');
readln(a);
readln(b);
c:=true;
while c do begin
c:=false;
j:=pos(a,b);
if j>0 then begin
inc(i);
c:=true;
v[i]:=j-1;
delete(b,j,1);
insert('-',b,j);
end;
end;
write(i);
if i<=1000 then
for j:=1 to i do write(v[j],' ')
else
for j:=1 to 1000 do write(v[j],' ')
end.