Răspuns:
program contorConsoane;
const voc=['a','A','e','E','i','I','o','O','u','U'];
Litere=['A'..'Z','a'..'z'];
var s:string;
i,contor:integer;
begin
write('Introdu text: '); read(s);
contor:=0;
for i:=1 to length(s) do
begin
if (s[i] in Litere)and ( not (s[i] in voc) )
then inc(contor);
end;
writeln('Textul contine ',contor,' consoane');
end.
Explicație: