编辑首次使用
#pragma once
/*template <typename T> void swap(T& a, T& b) {
T temp = a;
a = b;
b = temp;
}*/
void bubblesort1a(int* data, int n) {
bool sorted = false;
while(!sorted){
sorted = true;
for (unsigned i=0;i <n;++i)
if (*(data+i) > *(data+i+1)) {
//swap(i, i + 1);
sorted = false;
}
}
n--;
}