include vcl include iostream using namespace std void main int mass in

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <vcl>
#include <iostream>
using namespace std;
void main()
{
int mass[] = {4, 8, 3, 2, 0 , 7, 9, 5, 5};
int size_mass = sizeof(mass)/sizeof(mass[0]);
int mass_max_element = mass[0];
int index = 0;
for(int i = 0; i < size_mass; i++)
{
if(mass[i] > mass_max_element)
{
mass_max_element = mass[i];
index = i;
}
}
cout << "index\t" << index << " max\t" << mass_max_element ;
cin.get();
}