1 #include "iostream" 2 #include "cstdio" 3 #include "cstring" 4 #include "algorithm" 5 #include "vector" 6 using namespace std; 7 int k, n, ans[110]; 8 9 int main() 10 { 11 int i, j; 12 scanf("%d%d", &n ,&k); 13 for(i = 1; i <= n; ++i) { 14 scanf("%d", &ans[i]); 15 } 16 sort(ans + 1, ans + 1 + n); 17 printf("%d\n", ans[n - k + 1]); 18 }
时间: 2024-12-19 22:46:48