program raf105;
var
s: string;
g: integer;
function glas(s:string): integer;
const
glas_list = 'аяоёуюыиэе';
i,j,res:integer;
begin
s:= lowercase(s);
for i:=1 to length(s) do
for j:=1 to length(glas_list) do
if s[i] = glas_list[j]
then res:= res + 1;
glas:= res;
end;
write('Введите строку: ');
readln(s);
g:= glas(s);
writeln('В строке ',g,' глас.');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program raf105;
var
s: string;
g: integer;
function glas(s:string): integer;
const
glas_list = 'аяоёуюыиэе';
var
i,j,res:integer;
begin
s:= lowercase(s);
for i:=1 to length(s) do
for j:=1 to length(glas_list) do
if s[i] = glas_list[j]
then res:= res + 1;
glas:= res;
end;
begin
write('Введите строку: ');
readln(s);
g:= glas(s);
writeln('В строке ',g,' глас.');
end.
PascalABC 3.4.2