Составьте алгоритм, который в последовательности натуральных чисел а1, а2, а3 определяет сумму чисел кратных 5. Блок-схему нужно
Ответы на вопрос
Ответил ProSeyDon
0
Var
a:array[1..100000] of integer;
i,max,n:integer;
begin
Readln(n);
for i:= 1 to n do
read(a[i]);
max:=a[1]+a[n];
for i:= 2 to n div 2 do
if max < a[i] + a[n-i] then
max:= a[i] + a[n-i];
Writeln(max);
end.
вроде так
a:array[1..100000] of integer;
i,max,n:integer;
begin
Readln(n);
for i:= 1 to n do
read(a[i]);
max:=a[1]+a[n];
for i:= 2 to n div 2 do
if max < a[i] + a[n-i] then
max:= a[i] + a[n-i];
Writeln(max);
end.
вроде так
Новые вопросы