include vcl include iostream void main int mas int seredina int size_m

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <vcl.h>
#include <iostream.h>
void main()
{
int mas[] = {4, 8, 3, 2, 0 , 7, 9, 5};
int seredina;
int size_mas = sizeof(mas)/sizeof(mas[0]);
if (size_mas % 2 == 0)
{
seredina = size_mas/2;
cout << "Index serediny = " << seredina << endl;
cout << "Element serediny = " << mas[seredina];
}
else
{
cout << "net serediny oO" << endl;
}
cin.get();
}