tham khảo
uses crt;
var a:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau a:'); readln(a);
dem:=0;
d:=length(a);
for i:=1 to d do
if a[i]=' ' then inc(dem);
writeln(dem);
readln;
end.
uses crt;
var st:string;
d,i,dem:integer;
begin
clrscr;
readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if (st[i]='a') then dem:=dem+1;
writeln(dem);
readln;
end.