Pagini recente » Cod sursa (job #2369382) | Borderou de evaluare (job #1159097) | Cod sursa (job #479332) | Cod sursa (job #2269785) | Cod sursa (job #551565)
Cod sursa(job #551565)
const f = 'strmatch.in'; g = 'strmacth.out';
var
s, s1 : array[0..2000000] of char;
i, x, x2 : longint;
sol : array[0..1000] of longint;
begin
assign( input,f ); reset( input );
assign( output,g ); rewrite( output );
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;
i := pos ( s, s1 );
while i <> 0 do
begin
inc ( x );
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.