2 câu trả lời
program bai_giai;
uses crt;
var s,i,n:longint;
begin
clrscr;
write('nhap n:');readln(n);
s:=0;
for i:=1 to n do if(i mod 2=0)Then s:=s-i else s:=s+i;
write(s);
readln
end.
program bai_giai;
uses crt;
var s,i,n:longint;
begin
clrscr;
write('nhap n:');readln(n);
s:=0;
for i:=1 to n do if(i mod 2=0)Then s:=s-i else s:=s+i;
write(s);
readln
end.