Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program c1;
- uses crt;
- var
- i,j,k,n:byte;
- sum,s,x,l:real;
- function fact(z:byte):real;
- begin
- if z=0 then fact:=1
- else fact:=fact(z-1)*z;
- end;
- begin
- clrscr;
- writeln('Введите число n ');
- readln(n);
- x:=3;
- l:=1;
- s:=0;
- sum:=0;
- for k:=2 to n do begin
- l:=fact(k-1);
- for i:=0 to k do begin
- if i=0 then
- x:=1
- else
- x:=exp(ln(3) * i); //3 в степени x
- s:=s+x/l;
- writeln(x:9:3);
- writeln;
- end;
- sum:=sum+s;
- writeln(l:9:3);
- writeln(sum:9:3);
- writeln;
- writeln;
- writeln;
- end;
- writeln(sum:9:3);
- end.
Advertisement
Add Comment
Please, Sign In to add comment