var x,sum,i:integer;
begin
sum:=0;
writeln('Enter 3 numbers');
for i:=1 to 3 do
read(x);
if (x>=0) then sum:=sum+x;
end;
writeln('sum =', sum);
end.
Ввод : 1 -2 3
Вывод: sum =4
var x,sum,i:integer;
begin
sum:=0;
writeln('Enter 3 numbers');
for i:=1 to 3 do
begin
read(x);
if (x>=0) then sum:=sum+x;
end;
writeln('sum =', sum);
end.
Ввод : 1 -2 3
Вывод: sum =4