#include <iostream>
using namespace std;
int main()
{ int i, res;
const int n = 30;
int a[n];
srand(time(0));
for (i=0; i<n; i++)
{ a[i]=rand()%21-10;
cout << a[i] << " "; }
cout << endl;
for (i = 0; i < n; i++)
{
res+=a[i] * a[n - 1 - i];
}
cout << "ответ " << res;
return 0;
#include <iostream>
using namespace std;
int main()
{ int i, res;
const int n = 30;
int a[n];
srand(time(0));
for (i=0; i<n; i++)
{ a[i]=rand()%21-10;
cout << a[i] << " "; }
cout << endl;
for (i = 0; i < n; i++)
{
res+=a[i] * a[n - 1 - i];
}
cout << "ответ " << res;
return 0;
}