OJ-Problems-Source/CodeVS/1545_冰封.c

25 lines
445 B
C
Raw Normal View History

2016-07-06 14:28:18 +08:00
/*
:
:p1545
*/
#include <stdio.h>
#include <search.h>
int cmp (const void *a , const void *b){
return *(int*)a - *(int*)b;
}
int main(int argc, char* argv[]) {
int a, s[12];
memset(s, -1, sizeof(s[0]));
scanf("%i", &a);
int i;
for(i = 0; i < a; i++)
scanf("%i", &s[i]);
qsort(s, a, sizeof(s[0]), cmp);
for(i = 0; i < a; i++)
printf("%d\n", s[i]);
return 0;
}