Created
October 9, 2011 22:25
-
-
Save VoQn/1274290 to your computer and use it in GitHub Desktop.
AOJ V0 0001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int cmp(const void *a, const void *b){ | |
return -(*(int*)a - *(int*)b); | |
} | |
int main(void) { | |
int i, height; | |
int l = 10; | |
int hills[l]; | |
for (i = 0; i < l; i++) { | |
scanf("%d", &height); | |
hills[i] = height; | |
} | |
qsort(hills, l, sizeof(int), cmp); | |
for (i = 0; i < 3; i++) { | |
printf("%d\n", hills[i]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment