Рассматривая строку как массив символов, запрограммировать на паскале следующие процедуры и функции 1. Length;2.Copy;3.Pos;4.Insert;5.Delete.

29 Мар 2020 в 19:43
146 +1
0
Ответы
1

Примеры реализации процедур и функций на Pascal:

Length:

function StrLength(s: string): integer;
begin
StrLength := Length(s);
end;

Copy:

function StrCopy(s: string; index, count: integer): string;
begin
StrCopy := Copy(s, index, count);
end;

Pos:

function StrPos(subStr, s: string): integer;
begin
StrPos := Pos(subStr, s);
end;

Insert:

procedure StrInsert(var s, subStr: string; index: integer);
begin
Insert(subStr, s, index);
end;

Delete:

procedure StrDelete(var s: string; index, count: integer);
begin
Delete(s, index, count);
end;
18 Апр 2024 в 15:11
Не можешь разобраться в этой теме?
Обратись за помощью к экспертам
Гарантированные бесплатные доработки в течение 1 года
Быстрое выполнение от 2 часов
Проверка работы на плагиат
Поможем написать учебную работу
Прямой эфир