#include<queue> #include<vector> using namespace std; struct cmp //重写优先关系 从小到大 { bool operator () (const int a, const int b) const { return a%10 > b%10; } }; int main() { priority_queue<int, vector<int>,cmp> pq; //优先队列的声明 return 0; }