var i,n,s:longint;
begin
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('Tong la ',s);
readln;
end.
#include <iostream>
using namespace std;
int n,s,i;
int main()
{
s=0;
cout<<"nhap n";cin>>n;
for(i=1;i<=n;i++)s=s+2*i;
cout<<"ket qua la : "<<s;
return 0;
}