var text: string; freq: array['A'..'Z'] of integer; letter: char; begin for letter := 'A' to 'Z' do freq[letter] := 0;
writeln('Enter the text:'); readln(text);
for letter in text do begin if UpCase(letter) in ['A'..'Z'] then Inc(freq[UpCase(letter)]); end;
writeln('Frequency of each letter in the text:'); for letter := 'A' to 'Z' do begin if freq[letter] > 0 then writeln(letter, ': ', freq[letter]); end; end.
var
text: string;
freq: array['A'..'Z'] of integer;
letter: char;
begin
for letter := 'A' to 'Z' do
freq[letter] := 0;
writeln('Enter the text:');
readln(text);
for letter in text do
begin
if UpCase(letter) in ['A'..'Z'] then
Inc(freq[UpCase(letter)]);
end;
writeln('Frequency of each letter in the text:');
for letter := 'A' to 'Z' do
begin
if freq[letter] > 0 then
writeln(letter, ': ', freq[letter]);
end;
end.