**********************************************************
PROGRAM BT_Giai_thua;
USES crt;
VAR i,n:integer; s1:string;
Function Giaithua(x:integer):longint;
Var s,i:longint;
Begin
s:=1;
for i:=1 to x do s:=s*i;
Giaithua:=s;
End;
Function Tong(x:integer):real;
Var j:integer; s:real;
Begin
s:=0;
for j:=1 to x do s:=s+1/Giaithua(j);
Tong:=s;
End;
BEGIN
clrscr;
write('Nhap n:'); readln(n);
writeln(n,'!=', Giaithua(n));
writeln('Tong 1/1!+1/2!+...+1/',n,'! la:',Tong(n):0:2);
str(Giaithua(n),s1);
write('Sau khi xoa duoc:');
i:=length(s1)+1;
repeat
if s1[i-1]='0' then delete(s1,i-1,1)
else break;
i:=i-1;
until i=1 ;
write(s1);
readln;
END.