Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- using namespace std;
- void main() {
- double a = 1.0;
- double s = 0.0;
- double eps = 0.0001;
- setlocale(LC_ALL, "Russian");
- for(double i=1.0;eps<fabs(a);i++){
- a = (pow(-1.0, i) + 5*i)/pow(i, i);
- s+=a;
- }
- cout<<"Сумма равна: "<<s<<endl;
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement