var
a, i, NegativeSum, EvenCount : integer;
begin
EvenCount := 0;
NegativeSum := 0;
for i := 1 to 10 do
read (a);
if not Odd(a) then
inc(EvenCount);
if (a < 0) then
NegativeSum := NegativeSum + a;
end;
Write(EvenCount - NegativeSum)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const n=10;
var
a:array[1..n]of integer;
i,k:integer;
begin
for i:=1 to n do
read(a[i]);
k:=a[n];
for i:=n downto 2 do
a[i]:=a[i-1];
a[1]:=k;
for i:=1 to n do write(a[i],' ');
readln;
end.
var
a, i, NegativeSum, EvenCount : integer;
begin
EvenCount := 0;
NegativeSum := 0;
for i := 1 to 10 do
begin
read (a);
if not Odd(a) then
inc(EvenCount);
if (a < 0) then
NegativeSum := NegativeSum + a;
end;
Write(EvenCount - NegativeSum)
end.