Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project2;
- uses
- SysUtils;
- type
- TArrayOfString = array of string;
- procedure Rand(var a: TArrayOfString);
- var
- i: Integer;
- begin
- SetLength(a, Succ(Random(10)));
- for i := Low(a) to High(a) do
- a[i] := IntToStr(Random(MaxInt));
- end;
- procedure Print(a: TArrayOfString);
- var
- i: Integer;
- begin
- for i := Low(a) to High(a) do
- WriteLn(i, #9, a[i]);
- end;
- procedure Delete(var a: TArrayOfString; Index: Word);
- var
- i: Integer;
- begin
- for i := Index to Pred(High(a)) do
- a[i] := a[Succ(i)];
- SetLength(a, Pred(Length(a)));
- end;
- var
- n: Integer;
- a: TArrayOfString;
- begin
- Randomize;
- Rand(a);
- Print(a);
- WriteLn;
- n := Random(Length(a));
- WriteLn('Delete ', n);
- Delete(a, n);
- Print(a);
- ReadLn;
- end.
Add Comment
Please, Sign In to add comment