Cod sursa(job #1342715)
Utilizator | Data | 14 februarie 2015 14:05:31 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 14 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
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
inc(i);
c:=true;
if i<=1000 then
v[i]:=j;
delete(b,j,1);
insert('-',b,j);
end;
end;
writeln(i);
for j:=1 to i do write(v[j],' ');
end.