Pagini recente » Cod sursa (job #768180) | Cod sursa (job #2971607) | Cod sursa (job #2247301) | Cod sursa (job #2517603) | Cod sursa (job #551593)
Cod sursa(job #551593)
const f = 'strmatch.in'; g = 'strmatch.out';
var
//s, s1 : string [20000001];
s, s1 : array[0..2000001] of char;
i, x, x2 : longint;
sol : array[0..1001] of longint;
buf : array[1..1 shl 17] of char;
begin
assign( input,f ); reset( input );
assign( output,g ); rewrite( output );
settextbuf( input,buf);
{while not eoln( input ) do
begin
read( s[i] );
inc ( i );
end;
readln;
i := 0;
while not eoln( input ) do
begin
read( s1[i] );
inc ( i );
end;
}
readln(s);
read(s1);
i := pos ( s, s1 );
while i <> 0 do
begin
inc ( x );
//write( i-1,' ');
sol[ x ] := i-1;
S1[I] :=' ';
//delete(s1,i,1);
i := pos (s, s1);
end;
writeln( x );
for i := 1 to x do write( sol[i],' ');
end.