#include <iostream> using namespace std; void BubbleSort(int* a,int n){ for(size_t i=0;i<n;i++){ for(size_t j=n-1;j>i;j--){ if(a[j-1] > a[j]){ int tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; } } } } int main() { int a[] = {1,5,8,9,6,4,7,2,3,0}; int n = 10; BubbleSort(a,n); for(size_t i=0;i<n;i++){ cout << a[i] << " "; } return 0; }