Pagini recente » Cod sursa (job #2631287) | Cod sursa (job #2570984) | Cod sursa (job #2166449) | Cod sursa (job #2938589) | Cod sursa (job #1052247)
program strmatch;
var s,s1:ansistring;
i,j,k,nr,h:longint;
u:boolean;
a:array[1..10000] of longint;
begin
assign(input,'strmatch.in');
reset(input);
readln(s1);
readln(s);
close(input);
h:=1;
for i:= 1 to length(s)-length(s1) do begin
u:=true; k:=i;
for j:=1 to length(s1) do
if s[k]<>s1[j] then begin u:=false; break; end
else inc(k);
if u then begin inc(nr); a[h]:=i-1; inc(h); end;
end;
assign(output,'strmatch.out');
rewrite(output);
writeln(nr);
for i:=1 to nr do write(a[i],' ');
close(output);
end.