这么简单的题做了这么多遍才对,脑子坏掉了吧!
#include <iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
bool cmp(int a,int b)
{return a>b;
}
int main()
{int a[1001];int n,m;cin>>n;for(int i=1;i<=n;i++)cin>>a[i];cin>>m;while(m--){int b[1001];memset(b,0,sizeof(b));int l,r,k;cin>>l>>r>>k;for(int i=0;i<=r;i++)b[i]=a[i];sort(b+l,b+r+1,cmp);cout<<b[l+k-1]<<endl;}return 0;
}