#include<fstream>
using namespace std;
ifstream fin("date.in");
ofstream fout("date.out");
void sort(int a[100], int n)
{
if(n>1)
{
sort(a,n-1);
int i=n,aux;
while(a[i]<a[i-1] && i>1)
{ aux=a[i];
a[i]=a[i-1];
a[i-1]=aux;
i--;
}
}
}
int main()
{
int a[100], n,i;
fin>>n;
for(i=1;i<=n;i++) fin>>a[i];
sort(a,n);
for(i=1;i<=n;i++) fout<<a[i]<<" ";
fin.close();
fout.close();
return 0;
}
|