Create 1755.c

This commit is contained in:
Kirigaya Kazuto 2016-06-11 19:22:31 +08:00 committed by GitHub
parent 13800f40a5
commit eafa27063a

24
QUSTOJ/1755.c Normal file
View File

@ -0,0 +1,24 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXN 1024
int pool[MAXN];
int cmp(const void* a,const void* b)
{
return *(int*)b-*(int*)a;
}
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&pool[i]);
}
qsort(pool,n,sizeof(int),cmp);
for(int i=0;i<n;i++)
{
printf("%d ",pool[i]);
}
return 0;
}