📅  最后修改于: 2022-03-11 14:44:53.138000             🧑  作者: Mango
#include
using namespace std;
int main(){
const int size = 10;
int k = 3; //Can be any number smalled than size
int array[size] = {5,2,8,34,73,82,1,6,19,29};
sort(array,array+size);
int smallestKthElement = array[k-1];
int largestKthElement = array[size-k];
}