uses crt;
var s:string;
ktu:char;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(s);
write('Nhap ki tu:'); readln(ktu);
d:=length(s);
dem:=0;
for i:=1 to d do
if s[i]=ktu then inc(dem);
writeln('So ki tu ',ktu,' trong xau ',s,' la: ',dem);
for i:=1 to d do
if s[i]=ktu then delete(s,i,1);
writeln('Xau sau khi xoa cac ki tu ',ktu,' la: ',s);
readln;
end.