program Lab6_Var7;
var
  s: string;
  i, totalWords, kWords: integer;
  percent: real;
begin
  Writeln('Лабораторная работа 6. Вариант 7.');
  Writeln('Введите строку символов:');
  Readln(s);
  totalWords := 0;
  kWords := 0;
  for i := 1 to length(s) do
  begin
    if (s[i] <> ' ') and ((i = 1) or (s[i - 1] = ' ')) then
    begin
      totalWords := totalWords + 1;
      if (s[i] = 'К') or (s[i] = 'к') then
        kWords := kWords + 1;
    end;
  end;
  if totalWords > 0 then
    percent := (kWords / totalWords) * 100.0
  else
    percent := 0.0;
  Writeln('----------------------------------------');
  Writeln('Всего слов в строке: ', totalWords);
  Writeln('Слов, начинающихся на букву "К": ', kWords);
  Writeln('Процент слов на букву "К": ', percent:0:2, '%');
  Writeln('----------------------------------------');
  Readln;
end.