Program HOC24;
var i,n: integer;
tong,tich: longint;
begin
write('Nhap N: '); readln(n);
tong:=0; tich:=1;
for i:=1 to n do
begin
tong:=tong+i;
tich:=tich*i;
end;
writeln('Tong la: ',tong);
write('Tich la: ',tich);
readln
end.
program TinhTongTichTu1DenN;
var n, i: integer;
tong, tich: longint;
begin
tong := 0;
tich := 1;
write('Nhap vao n: ');
readln(n);
for i := 1 to n do
begin
tong := tong + i;
tich := tich * i;
end;
writeln('Tong cac so tu 1 den ', n, ': ', tong);
writeln('Tich cac so tu 1 den ', n, ': ', tich);
readln;
end.