Tag: C++

C++ 之优先队列

Jackey C/C++ 1,664 次浏览 ,
bool myCmp(int a, int b) { // 比较a和b的个位数 return a % 10 < b % 10; } int main() { srand(time(NULL)); // 默认情况下,最大堆 priority_queue<int> pq; for (int i = 0; i <...

C++中的map特性

Jackey C/C++ 1,652 次浏览 ,
int main() { map<int, int> myMap; // 查找 if (myMap.find(42) == myMap.end()) cout<<"Can not find element 42"<<endl; else cout<<"Element 42 is in the map"...
Go