var
i,sum:integer;
a:array[1..5] of integer;
begin
sum:=0;
writeln('Введите цифры');
for i:=1 to 5 do begin
read(a[i]);
sum:=sum+a[i];
end;
write(sum,' = ');
for i:=1 to 5 do
write(a[i],' + ');
end.
program sum_mas;
const n=5;
a:array[1..n] of integer;
for i:=1 to n do
write('sum=',sum);
readln;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
i,sum:integer;
a:array[1..5] of integer;
begin
sum:=0;
writeln('Введите цифры');
for i:=1 to 5 do begin
read(a[i]);
sum:=sum+a[i];
end;
write(sum,' = ');
for i:=1 to 5 do
write(a[i],' + ');
end.
program sum_mas;
const n=5;
var
a:array[1..n] of integer;
i,sum:integer;
begin
for i:=1 to n do
read(a[i]);
sum:=0;
for i:=1 to n do
sum:=sum+a[i];
write('sum=',sum);
readln;
end.