#include <iostream>
#include <math.h>
using namespace std;
int main()
{
srand(time(NULL));
int n=11,x,sum=0;
cin>>x;
int a[n];
for (int i=0; i<n; i++)
a[i]= random()%20;
sum+=(a[i]*pow(x,i));
cout<<a[i]<<" ";
}
cout<<endl<<"sum = "<<sum;
return 0;
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
srand(time(NULL));
int n=11,x,sum=0;
cin>>x;
int a[n];
for (int i=0; i<n; i++)
{
a[i]= random()%20;
sum+=(a[i]*pow(x,i));
cout<<a[i]<<" ";
}
cout<<endl<<"sum = "<<sum;
return 0;
}