uses crt;
const fo='xau.out'
var f1:text;
s1,s2:string;
d1,d2,dem:integer;
begin
clrscr;
assign(f1,fo); rewrite(f1);
write('Nhap xau s1:'); readln(s1);
write('Nhap xau s2:'); readln(s2);
d1:=length(s1);
d2:=length(s2);
writeln('Do dai xau ',s1,' la: ',d1);
writeln('Do dai xau ',s2,' la: ',d2);
dem:=0;
while pos(s2,s1)>0 do
begin
inc(dem);
delete(s1,pos(s2,s1),length(s2));
end;
writeln(f1,s1);
writeln(f1,s2);
writeln(f1,'So lan xuat hien cua xau s2 trong xau s1 la: ',dem);
close(f1);
readln;
end.