#include<bits/stdc++.h>
using namespace std;
int main()
{
long int i, j, n, m, maxi, mini;
while(cin >> n && n > 0)
{
int a[100+1] = {0};
maxi = 0;
mini = 100;
string ch = "";
for(i=1;i<=n;i++)
{
cin >> m;
if(m > maxi)
maxi = m;
if(m < mini)
mini = m;
a[m] = a[m] + 1;
}
for(i=mini;i<=maxi;i++)
{
if(a[i] > 0)
{
for(j=1;j<=a[i];j++)
{
cout << ch << i;
ch = " ";
}
}
}
cout << endl;
}
return 0;
}
using namespace std;
int main()
{
long int i, j, n, m, maxi, mini;
while(cin >> n && n > 0)
{
int a[100+1] = {0};
maxi = 0;
mini = 100;
string ch = "";
for(i=1;i<=n;i++)
{
cin >> m;
if(m > maxi)
maxi = m;
if(m < mini)
mini = m;
a[m] = a[m] + 1;
}
for(i=mini;i<=maxi;i++)
{
if(a[i] > 0)
{
for(j=1;j<=a[i];j++)
{
cout << ch << i;
ch = " ";
}
}
}
cout << endl;
}
return 0;
}
Comments
Post a Comment