program tinhtong; Var n , i : integer; S : longint; Begin write (‘ n = ‘) ; read(n); S:=1; For i : = 1 to n do S:=S+i*(i+1) ; writeln(‘Tong la: ‘,S); readln; end. Bình luận
var i,n: longint; kq: real;begin write(‘Nhap so n: ‘); readln(n); for i:=1 to n do kq:=kq+(i*(i+1)); writeln(‘Ket qua: ‘, kq:0:0); readlnend. Bình luận
program tinhtong;
Var n , i : integer;
S : longint;
Begin
write (‘ n = ‘) ; read(n);
S:=1;
For i : = 1 to n do S:=S+i*(i+1) ;
writeln(‘Tong la: ‘,S);
readln;
end.
var i,n: longint; kq: real;
begin
write(‘Nhap so n: ‘);
readln(n);
for i:=1 to n do kq:=kq+(i*(i+1));
writeln(‘Ket qua: ‘, kq:0:0);
readln
end.