Proagram bai1;
uses crt;
var n,i: integer;
x: real;
begin
clrscr;
write('nhap so n ='); readln(n);
x:=0;
for i:= 1 to n do
x:=x+i;
writeln('tong =' , x); readln
end.
program bt;
uses crt;
var n,i,x:integer;
begin
clrscr;
write('nhap n:');readln(n);
while (n<=0) do
begin
write('nhap lai n:');readln(n);
end;
x:=1;
for i:=1 to n do
x:=x*i;
write('x=',x);
readln;
end.
chúc bạn học tốt!