program tinh_tong ;
var i, n: integer; S: longint;
begin
clrscr;
writeln('Moi ban nhap n'); readln(n);
S:=0;
for i:= 1 to n do S:= S + 2*i;
writeln (' tong S la: ', S);
readln;
end.
program tinh_tong;
uses crt;
var j,k,i,n:integer;
s:real;
begin
clrscr;
repeat
write('Nhap n=');readln(n);
if n>=1 then break;
writeln('Hay nhap n>=1');
until false;
s:=0;
for i:=1 to n do
s:=s+2*i;
writeln('Tong: ',s:4:2);
readln
end.