Letter frequency: Difference between revisions

→‎Pascal: standardize [i.e. use ISO standards as basis]
(Add Draco)
(→‎Pascal: standardize [i.e. use ISO standards as basis])
Line 4,572:
 
=={{header|Pascal}}==
{{works with|Extended Pascal}}
<lang pascal>program letterFrequency(input, output, stdErr);
var
chart: array[char] of integer0..maxInt value [otherwise 0];
c: char;
begin
//{ parameter-less EOF() checks for EOF(input) }
for c := low(chart) to high(chart) do
while not EOF() do
begin
chart[c] := 0;
end;
// parameter-less EOF() checks for EOF(input)
while not EOF() do
begin
read(c);
inc(chart[c]); := chart[c] + 1
end;
//{ now, chart[someLetter] gives you the letter’s frequency }
end.</lang>
 
149

edits