Form and display an array of 9 elements, each 3 consecutive elements of which are composed according

Form and display an array of 9 elements, each 3 consecutive elements of which are composed according to the following rule: 1st is equal to the number entered from the keyboard; 2nd is equal to the current index, increased 10 times; 3rd is equal to the difference between a random two-digit number and the previous element.

Program mas;
var
A: array [1..100] of integer;
i, k, f: integer;
begin
randomize;
k: = – 2;
for i: = 1 to 3 do
begin
k: = k + 3;
readln (A [k]);
A [k + 1]: = (k + 1) * 10;
writeln (A [k + 1]);
f: = random (90) +9;
A [k + 2]: = f-A [k + 1];
writeln (A [k + 2], ‘(‘, f, ‘)’);
end;
readln;
end.

To form such an array, we start a cycle with a parameter from 1 to 3, in each circle of the cycle we will form three numbers. The parameter k is initially set equal to -2 in order to obtain indices 1, 4, 7 by the formula k: = k + 3.
1, 4, 7 (A [k]) we enter from the keyboard; 2, 5, 8 – just increase the index k + 1 by 10 times; and to get 3, 6 and 9 elements, we first generate a random two-digit number f, and then find its difference with the previous element. (!) For verification, this random number is indicated in brackets. If necessary, you can remove this code and enter: writeln (A [k + 2]);



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.