var
N,x,s,i : integer;
begin
s:=0;
readln(N);
for i := 1 to N do
readln(x);
if x > 0 then
s := s + x;
end;
if s > 0 then
writeln(s)
else
writeln('Нет положительных чисел');
end.
program Hello;
const N : integer = 10;
var i, sum, val: integer;
sum := 0;
read(val);
if val > 0 then
sum := sum + val;
if sum > 0 then
writeln ( sum )
writeln ( 'No positive values' )
Объяснение:
var
N,x,s,i : integer;
begin
s:=0;
readln(N);
for i := 1 to N do
begin
readln(x);
if x > 0 then
s := s + x;
end;
if s > 0 then
writeln(s)
else
writeln('Нет положительных чисел');
end.
program Hello;
const N : integer = 10;
var i, sum, val: integer;
begin
sum := 0;
for i := 1 to N do
begin
read(val);
if val > 0 then
sum := sum + val;
end;
if sum > 0 then
writeln ( sum )
else
writeln ( 'No positive values' )
end.
Объяснение: