fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void bubble_sort(int a[],int n)
  5. {
  6. int i,j;
  7. for( i = 0 ; i < n-1 ; i++)
  8. for( j = 0 ; j < n-i-1 ; j++)
  9. if(a[j] > a[j+1])
  10. swap(a[j],a[j-1]);
  11. }
  12.  
  13. int main() {
  14. // your code goes here
  15. return 0;
  16. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty