uses crt;
var i,n:integer;
s:longint;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+sqr(i);
writeln('tong S=',s);
readln;
end.
Program Tinh_tong_Sara;
uses crt;
var i,n:integer;
s:longint;
Begin
clrscr;
Write('Nhap n:'); Readln(n);
s:=0;
For i:=1 to n do s:=s+sqr(i);
Writeln('Tong cua S la:',s);
Readln
End.
uses crt;
var i,n:integer;
s:longint;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+sqr(i);
writeln('tong S=',s);
readln;
end.
const
fi='TONG.INP'
fo='TONG.OUT'
var
i,n,tong:integer;
begin
assign(f,fi);reset(f);
read(f,n);
close(f);
assign(f,fo);
rewrite(f);
tong:=0;
for i:=1 to n do
tong:=tong+i*i;
write(f,tong);
close(f);
end.