Make your own free website on Tripod.com

program number_of_a ;
uses wincrt;
var
name : string;
i, j, i2, j2, no : integer;
begin
write('What is your name ?');
readln(name);
i := 0;
for j := 1 to length(name) do
if name[j] = 'a'
then i := i + 1;
i2 := 0;
for j2 := 1 to length(name) do
if name[j2] = 'A'
then i2 := i2 + 1;
no := i2 + i;
writeln('Your name has ', no,' A and a !')
end.