#include
#include
#include
using namespace std;
int main()
{
srand(time(NULL));
int N = 10, A[N], Max = 1;
cout << "A:";<br> for(int i = 0; i < N; i++)
{
A[i] = rand() % 281 - 140;
cout << " " << A[i];<br> if (A[i] > A[Max]) Max = i;
}
cout << "\nMax = " << A[Max] << "["<<Max+1<<"]";<br> N = Max - 2;
if (N < 0) N = -N;
int B[--N];
for(int i = 2; i < Max; i++)
B[i-3] = A[i];
for(int i = 2; i > Max; i--)
B[i-2] = A[i];
cout << "\nB:";<br> for(int i = 0; i < N; i++)
cout << " "<< B[i];<br>}