Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Khai bao cac ham thu vien cua chuowng trinh
- //
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int n,x;
- scanf("%d%d",&n,&x);
- if(n==0)
- printf("1");
- else
- {
- long double t=1;
- long double s=1;
- long double kq=0;
- for(int i=1;i<=n;i++)
- {
- t=t*x;
- s=s*i;
- kq=kq+ t/s;
- }
- printf("%.3lf",kq);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement