Pagini recente » Cod sursa (job #2448695) | Cod sursa (job #2148126) | Cod sursa (job #10022) | Cod sursa (job #1274719) | Cod sursa (job #1342700)
var a,b:string;
i,j:longint;
c:boolean;
v:array[0..1000] 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
c:=true;
if i<=1000 then
v[i]:=j;
inc(i);
delete(b,j,1);
insert('-',b,j);
end;
end;
writeln(i);
for j:=0 to i-1 do write(v[j],' ');
end.