Stupid bubble sort algorithm implementation in Cpp