Гласные буквы
Вывести все гласные буквы, содержащиеся в слове наибольшей длины и вывести число повторений каждой этой буквы.

Формат входных данных

Формат выходных данных


Код программы на паскаль:
const
g : array [1..9] of char = ('а', 'е', 'и', 'о', 'у', 'ы', 'э', 'ю' , 'я');
var
Text, Twords : string;
Max, count, i, j : integer;
begin
Write('Введите текст: '); Readln(Text);
Text := Text + ' ';
max := 0;
while Text <> '' do
begin
if Length(copy(Text, 1, pos(' ', Text))) > max then
begin
max := Length(copy(Text, 1, pos(' ', Text)));
TWords := copy(Text, 1, pos(' ', Text));
end;
delete(Text, 1, pos(' ', Text));
end;
Writeln('Слово наибольшей длины: ', Twords);
for j := 1 to 9 do
begin
count := 0;
for i := 1 to Length(Twords) do
if g[j] = Twords[i] then inc(count);
if count <> 0 then Writeln(g[j], ' = ', count);
end;
end.

This site was made on Tilda — a website builder that helps to create a website without any code
Create a website