program permainan_huruf;
uses crt;
type
az = 'a'..'z';
kalimat = array[az] of byte;
var
huruf : char;
kata : string;
besar : az;
pernyataan : kalimat;
i : byte;
begin
clrscr;
for besar := 'a' to 'z' do
pernyataan[besar] :=0;
write(' tulis kalimat '); readln(kata);
for i := 1 to length(kata) do
begin
huruf := kata[i];
if(huruf>='a') and (huruf<='z')
then inc(pernyataan[huruf]);
end;
for besar:= 'a' to 'z' do
if pernyataan[besar] <>0 then
writeln('jumlah huruf','':5,besar,'=':2,pernyataan[besar]);
repeat until keypressed;
end.
0 Komentar:
Posting Komentar