const n=10;
var a: array[1..n] of integer;
i,s: integer;
begin
s:=0;
write('massiv: ');
for i:=1 to n do begin
a[i]:=random(201)-100;
write(a[i],' ');
s:=s+a[i];
end;
writeln;
write('sum=',s);
end.
a =[1, 2, 3]
print (sum(a))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n=10;
var a: array[1..n] of integer;
i,s: integer;
begin
s:=0;
write('massiv: ');
for i:=1 to n do begin
a[i]:=random(201)-100;
write(a[i],' ');
s:=s+a[i];
end;
writeln;
write('sum=',s);
end.
Verified answer
a =[1, 2, 3]
print (sum(a))