Advertisement
kostes

1ab

Jan 15th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int m;
  6. cout << "vvedite m\n";
  7. cin >> m;
  8. double sum = 0;
  9. for(int n = 1; n <= m; n++)
  10. {
  11. double f = 1;
  12. for(int i = 0; i < n; i++)
  13. f *= 2;
  14. double s = 1;
  15. for(int i = 0; i < n; i++)
  16. s *= 3;
  17. sum += f / s;
  18. }
  19. cout << sum;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement