Считается по формуле суммы членов арифметической прогрессии: Sn=((a1+an)/2)*n, то есть ((1+212)/2)*212
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[10];
srand(time(0));
for(int i = 0; i < 10; i++)
{
a[i] = rand() % 201 - 100;
cout << a[i] << ' ';
}
cout << endl;
int temp;
for(int i = 0; i < 5; i++)
{
temp = a[i];
a[i] = a[i + 5];
a[i + 5] = temp;
}
for(int i = 0; i < 10; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}
Ответ:
не, бред какой-то
звони оператору, выясняй с ним, почему минут нет