#include <iostream> #include <queue> using namespace std; int main() { priority_queue <int> i; i.push(110); i.push(202); i.push(303); i.push(40); do { cout<<i.top()<<endl; i.pop(); }while(!i.empty()); system("pause"); return 0; }This is the output:
303 202 110 40
0 comments:
Post a Comment