Advertisement
NoExisteLink

Sumatoria

May 9th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int k,i;
  9. float a, suma , s_act;
  10. cin>> k >> a;
  11. s_act=1;
  12. suma=1;
  13. for(i=1;i<=k;i++){
  14. s_act=s_act*a/i;
  15. suma +=s_act;
  16. }
  17. cout<< suma;
  18. getchar();
  19. getchar();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement