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