var n,i:integer;
s:longint;
begin
write('Nhap so n='); readln(n);
if n mod 2 = 0 then write(n,' khong phai la so nguyen le')
else begin for i:=1 to n do
s:=s+(i*i);
write('Tong S=',s); end;
end.
uses crt;
var n,s,i:integer;
begin
clrscr;
repeat
write('n=');readln(n);
if (n<=0) or (n mod 2=0) then writeln('ban da nhap sai, yeu cau ban nhap lai');
until (n>0) and (n mod 2=1);
s:=0;
for i:=1 to n do
s:=s+sqr(i);
writeln('tong la: ',s);
readln;
end.
uses crt;
var i,n,s:longint;
begin
clrscr;
write('n='); readln(n);
if n mod 2=1 then
begin
s:=0;
for i:=1 to n do
s:=s+i*i;
writeln('tong la: ',s);
end
else writeln('sai dieu kien');
readln;
end.