标签:des style java color os strong
3 1 2 5 -1 5 3 1 2 3 4 5 0 0
5 5 4 3
#include<stdio.h>
#include<stdlib.h>
#define MAXN 100000+10
int a[MAXN];
int cmp(const void *b,const void *a)
{
return *(int *)a-*(int *)b;
}
int main()
{
int n,m;
while(scanf("%d%d",&n,&m)&&n!=0&&m!=0)
{
int i,j;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
qsort(a,n,sizeof(a[0]),cmp);
printf("%d",a[0]);
for(j=1;j<m;j++)
printf(" %d",a[j]);
printf("\n");
}
return 0;
}
标签:des style java color os strong
原文地址:http://blog.csdn.net/qq_16767427/article/details/38039037