Вот так по приличнее будет, я думаю:
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| #include <iostream>
using namespace std;
//========================================================
int array[100];
//========================================================
void Sort(int col)
{
int trash;
bool f;
do {
f = false;
for(int i = 0; i < col - 1; i++)
if (array[i] > array[i+1]) {
f = true;
trash = array[i];
array[i] = array[i+1];
array[i+1] = trash;
}
} while(f);
} |
|