Advertisement
STANAANDREY

windows api

Sep 1st, 2023 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5. class WinCmdFns {
  6. public:
  7.     static void setColor(int ForgC) {
  8.         WORD wColor;
  9.         HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  10.         CONSOLE_SCREEN_BUFFER_INFO csbi;
  11.         if (GetConsoleScreenBufferInfo(hStdOut, &csbi)) {
  12.             wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);
  13.             SetConsoleTextAttribute(hStdOut, wColor);
  14.         }
  15.     }
  16. };
  17.  
  18.  struct Edge {
  19.         int to, time;
  20.     };
  21.     struct EdgeCmp {
  22.         bool operator() (const Edge &e1, const Edge &e2) {
  23.             return e1.time < e2.time;
  24.         }
  25.     };
  26.  
  27. int main() {
  28.     priority_queue<Edge, vector<Edge>, EdgeCmp> pq;
  29.     pq.push({-1, 12});
  30.     pq.push({-1, 33});
  31.     cerr << pq.top().time << endl;
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement