#include <bits/stdc++.h>
using namespace std;
void sortList(int ourList[], int n)
{
int i, key, j;
for (i = 1; i < n; i++)
{
key = ourList[i];
j = i - 1;
while (j >= 0 && ourList[j] > key)
{
ourList[j + 1] = ourList[j];
j = j - 1;
}
ourList[j + 1] = key;
}
}
void printList(int ourList[], int n)
{
int i;
for (i = 0; i < n; i++)
cout << ourList[i] << " ";
cout << endl;
}
int main()
{
int ourList[] = { 12, 11, 13, 5, 6 };
int n = sizeof(ourList) / sizeof(ourList[0]);
sortList(ourList, n);
printList(ourList, n);
return 0;
}