Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- { // problema 9
- unsigned n,e=0,i;
- float x,S=0,p=1.0;
- cout<<"x=";cin>>x;
- cout<<"n=";cin>>n;
- for (i=1;i<=n;i++)
- {
- p*=x;
- e+=i;
- S+=p/e;
- }
- cout<<"S="<<S;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement