MrYadro

Untitled

Sep 28th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include
  2. #include
  3. #include
  4.  
  5. int main()
  6. {
  7. float y, s, x, eps;
  8. int i;
  9.  
  10. freopen("input.txt", "r", stdin);
  11. freopen("output.txt", "w", stdout);
  12.  
  13. scanf("%.2f\n%.5f", &x, &eps);
  14.  
  15. i = 1;
  16. while (y >= eps)
  17. {
  18.  
  19. y = x*x*x;
  20. y /= (2*i - 1);
  21. s +=y;
  22. y *= (2*i - 1);
  23. i++;
  24. }
  25. printf("%.5f", s);
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment