uses crt; var n,i,s,x,t,d: longint; begin clrscr; write ('nhap n: '); readln (n); write ('nhap x: '); readln (x); for i:=1 to n do begin repeat x:=x*x; d:=d+1; until d=i; s:=s+x; end; writeln ('tong la: ',s); readln; end.
uses crt; var n,i:integer; s:extended; function somu(x,n:integer):extended; var tam:integer; begin somu:=1; for tam:=1 to n do somu:=somu*x; end; BEGIN clrscr; write('Nhap n:'); readln(n); s:=0; for i:=1 to n do s:=s+somu(n,i); write('TONG LA:',S:0:0); readln END.