c++基础
我是路人戊
Nobody can go back and start a new beginning, but anyone can start now and make a new ending.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++二维数组按照指定规则排序
#include <iostream> #include <vector> #include<algorithm> using namespace std; int main() { vector<vector<int>> vec = { {2,3}, {1,8}, {5,4}, {6,4}, {5,2}, {6,7}, {5,5} }; sort(vec.begin(), vec.end(), [](c.原创 2021-01-06 17:27:45 · 740 阅读 · 0 评论 -
c++遍历map
c++遍历map # include <iostream> # include <unordered_map> # using namespace std; int main() { unordered_map<char, int> ma = { {'a',1}, {'b',2}, {'c',3}}; // 法一。c++11 for (auto &p : ma)原创 2020-12-27 12:13:45 · 512 阅读 · 0 评论 -
c++ 结构体重载==
c++ 结构体重载== struct bbox { float x, y, w, h; //重载==运算符,相等返回1,不等返回0 bool operator==(const bbox &p) { return (x==p.x && y==p.y && w==p.w && h==p.h); } }; int main(int argc, char const *argv[]) { bbox a原创 2020-09-29 10:19:00 · 2075 阅读 · 0 评论
分享