2 câu trả lời
uses crt;
var i, s, n : integer;
begin
clrscr;
write('nhap so n : ');readln(n);
s := 0;
for i := 1 to n do
if i mod 2 = 0 then s := s - i
else s := s + i;
writeln('tong s = ', s);
readln
end.
uses crt;
var n,s,i:longint;
begin
clrscr;
write('n');
readln(n);
i:=0;
for i:=1 to n do
if i mod 2=0 then s:=s-i
else
s:=s+i;
writeln('s',s);
readln
end.
`#khoadang09#`