Program hotrotinhoc;
var s: longint;
i,n: integer;
function lt(x,y: integer): longint;
var l,t: longint;
begin
t:=1;
for l:=1 to y do t:=t*x;
lt:=t;
end;
begin
write('N='); readln(n);
for i:=2 to n do
if (i-1) mod 2<>0 then s:=s+lt((i-1),i)
else
if (i-1) mod 2=0 then s:=s-lt((i-1),i);
write(s);
readln
end.
mn ơi giúp mk vs!
cảm ơn trước.