Uses Crt;
Var St:String;
dem: Array[‘A’..’Z’] Of Byte;
i:Byte;
ch:Char;
Begin
Write(‘Nhap xau St: ‘); Readln(St);
{Khởi tạo mảng}
For ch:=’A’ To ‘Z’ Do dem[ch]:=0;
{Duyệt xâu}
For i:=1 To Length(St) Do
If Upcase(St[i]) IN [‘A’..’Z’] Then Inc(dem[Upcase(St[i])]);
{Liệt kê các ký tự ra màn hình}
For ch:=’A’ To ‘Z’ Do
If dem[ch]>0 Then Writeln(ch,’ : ’,dem[ch]);
Readln;
uses crt;
var st:string;
begin
clrscr;
write('Nhap xau:'); readln(st);
writeln(length(st));
readln;
end.