题解 | #争夺前五名#
争夺前五名
http://www.nowcoder.com/practice/cd052308a1c44a88ad00255f312c3e14
int main() {
int n, temp;
scanf("%d", &n);
int m[n];
for (int i = 0; i < n; i++) {
scanf("%d ", &m[i]);
}
for (int j = 0; j < n; j++) {
for (int k = 0; k < n; k++) {
if (m[j] > m[k]) {
temp = m[j];
m[j] = m[k];
m[k] = temp;
}
}
}
printf("%d %d %d %d %d", m[0], m[1], m[2], m[3], m[4]);
return 0;
}