Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double summary = 0;
- int N;
- cout << "Enter the amount of elements(N): ";
- cin >> N;
- for (int i = 0; i < N; i++)
- {
- double temp = 1.0 / double((i + 1) * (i + 1) * (i + 1));
- summary += temp;
- }
- cout << endl << "Your summary is " << summary << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement