У меня вот такой вариант решения:
Код:
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
double summ(int a, int b);
int x,i;
int main() {
cout<<"enter the argument (x)"<<endl;
cin>>x;
cout<<endl;
cout<<"enter the number (i)"<<endl;
cin>>i;
cout<<endl;
cout<<"sum "<<i<<" members of this sequence with an argument "<<x<<" is equal to "<<summ(x,i)<<endl;
system ("pause");;
}
double summ(int a, int b){
int sum=0;
for (a=0;a<i;a++)
sum+=pow(-1,i)*pow(x,i);
return sum;
}