Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     setlocale (LC_ALL, "rus");
  7.     cout << ("Введите число суммирований ");
  8.     int n, i = 2;
  9.     float sum = 1.0;
  10.     cin >> n;
  11.     for (i; i < (n + 1); i++) {
  12.         sum = sum + 1.0/ (i * i * i);
  13.     }
  14.     cout << ("Сумма равна ") << sum;
  15.     return 0;
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement