#include <iostream>
using namespace std;
const int SIZE=50;
int main()
{
int i,arr[SIZE],num;
cin>>num;
for (i=0;i<num;i++)
cin>>arr[i];
for (i=0;i<num-1;i++)
{
for (int j=0;j<num-i-1;j++)
{
if(arr[j]>arr[j+1])
{
int temp=arr[j+1];
arr[j+1]=arr[j];
arr[j]=temp;
}
}
}
for (i=0;i<num;i++)
cout<<arr[i]<<" ";
cout<<endl;
return 0;
}
#include <algorithm>
using std::swap;
void sort(int* a, int n)
{
bool changed;
do{
changed = false;
for(int i=1; i<n; i++){
if(a[i]<a[i-1]){
swap(a[i],a[i-1]);
changed = true;
}
}
--n;
}while(changed);
}
#include using namespace std;const int SIZE=50;int main(){ int i,arr[SIZE],num; cin>>num; for (i=0;i<num;i++) cin>>arr[i]; for (i=0;i<num-1;i++) { for (int j=0;j<num-i-1;