Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- using namespace std;
- bool DoYouWantToCalculateThisAgain() {
- }
- bool IsInt(long double number) {
- return true;
- }
- int main() {
- long double x;
- long double alpha;
- cin >> x >> alpha;
- do {
- if (IsInt(alpha)) {
- long double sum = 0;
- for (int n = 0; n < int(alpha); ++n) {
- long double summand = pow(x, 2 * n + 1) / (2 * n + 1);
- sum += summand;
- cout << setprecision(15) << n << ' ' << summand << ' ' << sum << ' ' << abs(summand / sum) << '\n';
- }
- cout << sum << '\n';
- } else {
- long double sum = 0;
- long double summand = pow(x, 2 + 1) / (2 + 1);
- while(alpha < )
- }
- } while (DoYouWantToCalculateThisAgain());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement