program HomeWork;
const N = 5;
var a:array[1..N] of integer;
var i, s:integer;
begin
while i < N do
a[i] := random(100);
write(a[i], ' ');
s := s + a[i];
i := i + 1;
end;
writeln();
writeln('Сумма элементов массива равна: ', s);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program HomeWork;
const N = 5;
var a:array[1..N] of integer;
var i, s:integer;
begin
while i < N do
begin
a[i] := random(100);
write(a[i], ' ');
s := s + a[i];
i := i + 1;
end;
writeln();
writeln('Сумма элементов массива равна: ', s);
end.