Pagini recente » Cod sursa (job #2330629) | Cod sursa (job #147148) | Cod sursa (job #31567) | Cod sursa (job #1223445) | Cod sursa (job #1387231)
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);
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;
delete(b,j,1);
insert('-',b,j);
end;
end;
writeln(i);
for j:=1 to i do write(v[j],' ');
end.