var a,b,i,sn,sc: integer;
begin
readln(a);
readln(b);
sc:=0;
sn:=0;
for i:=a to b do
if i mod 2=0 then sc:=sc+i
else sn:=sn+i;
write(sc-sn);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
var a,b,i,sn,sc: integer;
begin
readln(a);
readln(b);
sc:=0;
sn:=0;
for i:=a to b do
if i mod 2=0 then sc:=sc+i
else sn:=sn+i;
write(sc-sn);
end.