桶排序:
代码语言:javascript复制#include <stdio.h>
#include <string.h>
int a[5555555];
int main()
{
int n,m;
scanf("%d",&n);
memset(a,0,sizeof(a));
for(int i = 0; i < n; i )
{
scanf("%d",&m) ;
if(m >= 100) a[100] ;
else a[m] ;
}
for(int i = 0; i < 101; i )
{
if(a[i] != 0)
printf("%d %dn",i,a[i]);
}
return 0 ;
}