日志打印文件名

template<int N> inline const char * CompileTimeGetFileName(const char(&arr)[N]) { //in…

vscode配置调试c++

tasks.json { "tasks": [ { "type": "shell", "lab…

字符串排序

#include <stddef.h> #include <stdio.h> int compareString(char *s1, char *s2) { whil…

weak_ptr使用的几个实例

#include <iostream> #include <memory> #include <algorithm> #include <string&gt…

多个单例对象,析构顺序模拟

#include <iostream> #include <unistd.h> using namespace std; struct StaticMember { publ…

[重新解答]百度笔试:数组按频次排列

题意为从一个乱序数组中,将其中的整数按照出现的频次多少来排列(并且出现几次就排列几个),比如输入为[1,2,1,2,3,3,1,6,4,4,4,4],那么输出就应该为[4,4,4,4,1,1,1,2…

O(nLogn)排序 :堆

#include <iostream> #include <vector> #include <algorithm> using namespace std; v…

链表快速排序

#include <iostream> #include <vector> #include <list> #include <iterator> #i…

[重新解答]阿里笔试:去重和排序,重新输出Markdown格式

在网上偶然看到一道题目,发现博主的答案有问题,所以重新解答一下题目 原题链接【https://blog.csdn.net/qq_29108585/article/details/60956567】 …

实现C++字符串的spilt

std::string mySplit(std::string src, uint8_t field ,char delim=' ') { std::stringstream ss(…