# include<cstdio>
# include<iostream>
using namespace std;
int main(void)
{
int a[11];
int t;
for ( int i = 0;i <= 10;i++ )a[i] = 0;
for ( int i = 1;i <= 5;i++ )
{
cin>>t;
a[t]++;
}
for ( int i = 0;i <= 10;i++ )
{//从小到大的输出
for ( int j = 1;j <= a[i];j++ )
{
cout<<i<<" ";
}
}
//getchar();
//getchar();
for ( int i = 10;i >= 0;i-- )
{//从大到小的输出
for ( int j = 1;j <= a[i];j++ )
cout<<i<<" ";
}
return 0;
}
第一章排序----桶排序
最新推荐文章于 2018-03-06 16:30:59 发布