program CountChar;
var
s: string;
c: Char;
i, count: Integer;
begin
Write ('Введите строку: ');
ReadLn (s);
Write ('Введите символ: ');
ReadLn (c);
count := 0;
for i := 1 to Length (s) do begin
if s [i] = c then
Inc (count);
end;
WriteLn ('В строке ', count, ' символов "', c, '"');
ReadLn;
end.
program CountChar;
var
s: string;
c: Char;
i, count: Integer;
begin
Write ('Введите строку: ');
ReadLn (s);
Write ('Введите символ: ');
ReadLn (c);
count := 0;
for i := 1 to Length (s) do begin
if s [i] = c then
Inc (count);
end;
WriteLn ('В строке ', count, ' символов "', c, '"');
ReadLn;
end.