$ cpp array bubble sort
#include<iostream>
using namespace std;
int main()
{
int a[3] = {2, 1, 0};
for(int i = 2; i > 0; i--)
{
for(int j = 0; j < i; j++)
{
if(a[j] > a[j + 1])
{
swap(a[j], a[j + 1]);
}
}
}
for(int i = 0; i < 3; i++)
{
cout << a[i] << ' ';
}
cout << endl;
}