varz,y,i: integer;a: array [1..10] of integer;begin
for i:=1 to 10 do read (a[i]);y:=0; z:=1;for i:=1 to 10 dobegin if a[i]>0 then z:=z+a[i] else y:=y+a[i];end;writeln ('y=',y);writeln ('z=',z);end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
z,y,i: integer;
a: array [1..10] of integer;
begin
for i:=1 to 10 do read (a[i]);
y:=0; z:=1;
for i:=1 to 10 do
begin
if a[i]>0 then
z:=z+a[i]
else
y:=y+a[i];
end;
writeln ('y=',y);
writeln ('z=',z);
end.