Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- using namespace std;
- int main()
- {
- int k,i;
- float a, suma , s_act;
- cin>> k >> a;
- s_act=1;
- suma=1;
- for(i=1;i<=k;i++){
- s_act=s_act*a/i;
- suma +=s_act;
- }
- cout<< suma;
- getchar();
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement