Черновое решение задачи последовательности файлов

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
program posl;
var
mass : array [1..11] of integer;
i, m, num, l1, l2, tp, ost : integer;
begin
num := 1;
for i := 1 to 11 do
begin
write (num, '.', ' элемент массива: ');
readln (mass[i]);
inc (num);
end;
writeln;
writeln ('Массив');
for i := 1 to 11 do
writeln (mass[i]);
writeln;
writeln ('Результаты');
m := mass[1];
l1 := 2;
l2 := 3;
if (mass[l1] + mass[l2]) < m then
writeln (mass[l1], mass[l2]);
while l2 < 11 do
begin
if (mass[l1] + mass[l2]) = m then
writeln (mass[l1], mass[l2])
else
if (mass[l1] + mass[l2]) > m then
begin
tp := mass[l1] + mass[l2] - m;
ost := mass[l2] - tp;
writeln (mass[l1], tp);
write (ost);
end;
l1 := l1 + 2;
l2 := l2 + 2;
end;
end.