include vcl include iostream void main int mas int stak nu_min_el nu_e

 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
27
28
29
#include <vcl.h>
#include <iostream.h>
void main()
{
int mas[] = {4, 8, 3, 2, 0 , 7, 9, 5};
int stak, nu_min_el,nu_el,sum;
int size_mas = sizeof(mas)/sizeof(mas[0]);
for(int i = 0; i < size_mas; i++)
{
for(int j = 0; j <size_mas; i++)
{
if (mas[j + 1] > mas[j])
{
stak = mas[j];
mas[j] = mas[j+1];
mas[j+1] = stak;
}
}
}
/* for(int j = 0; j < size_mas; j++)
{
cout << mas[j] << " ";
}
*/
cin.get();
}