September 2021 0 16 Report
Массив A заполнили, а потом изменили. Pascal:

n := 100;

for i := 1 to n do
A[i] := i;

for i := 1 to n div 2 do
A[i] := A[n + 1 - i];

Python:

n = 100
a = []

for i in range(0, n):
a.append(i + 1)

for i in range(0, n // 2):
a[i] = a[n - 1 - i]

Чему равна сумма первого и последнего элементов полученного в итоге массива?
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.