#include <iostream>
using namespace std;
int main() {
int m[6] = {5, 2, 4, 6, 1, 3};
int key = 0;
int i = 0;
int length = sizeof(m) / sizeof(int);
for(int j = 2; j <= length; j++) {
key = m[j-1];
i = j - 1;
while(i > 0 && m[j-1] > 0) {
m[i + 1-1] = m[j-1];
i = i - 1;
}
m[i + 1-1] = key;
}
}