Bob103

проверить

Nov 25th, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include<iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. {
  6. int n, i = 1;
  7. float e, s = 0, b = 1/3;
  8. cout << "e="; cin >> e;
  9. while (fabs(b)>= e)
  10. {
  11. s += -1; i++;
  12. b / pow(3, 2 * i - 1);
  13. }
  14. cout << "s=" << s << endl;
  15. system("pause");
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment