自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 资源 (1)
  • 收藏
  • 关注

原创 leetcode 寻找两个正序数组的中位数 题解实现

From:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/4. 寻找两个正序数组的中位数给定两个大小为 m 和 n 的正序(从小到大)数组nums1和nums2。请你找出这两个正序数组的中位数,并且要求算法的时间复杂度为O(log(m + n))。你可以假设nums1和nums2不会同时为空。示例 1:nums1 = [1, 3]nums2 = [2]则中位数是 2.0...

2020-05-13 16:58:46 550

原创 C++ 判定字符串是否为数值

bool isIntNum(const string&str, const bool& bIsHex){ if (str.empty()) return false; auto it = str.begin(); if (str.at(0) == '-' && str.size() > 1) { ++it; } for (; it != ...

2020-05-05 11:12:33 603

原创 C++ 字符串拆分

vector<string> splitStr(const string &str, char seoperator){ int iSize = str.size(); if (iSize == 0) return vector<string>(0); int iCount = count(str.begin(), str.end(), seopera...

2020-05-05 11:09:24 453

原创 C++ 获取系统时间

//Y年M月D日H时M分S秒M毫秒typedef enum DataType { YMD = 0,//年月日 YMDHMS,//年月日时分秒 YMDHMSM, //年月日时分秒毫秒 DMY,//日月年 MDY,//月日年 HMS,//时分秒 HMSM//时分秒毫秒}DATATYPE;string getSysTime(const DATATYPE& iMode, c...

2020-05-05 09:46:32 217

原创 C++ 目录中文件查找

bool sort_finddata_tByTimeCreateUp(const _finddata_t& f1, const _finddata_t& f2){ return f1.time_create < f2.time_create;}bool sort_finddata_tByTimeCreateDown(const _finddata_t& f...

2020-05-05 09:43:21 504

原创 C++ 文件输出

/* -- strFilePath - 文件路径 -- bIsBinary -是否为二进制文件读取方式*/bool outAllFile(const string& strFilePath, const string& strSrc, const unsigned int& uMode, const bool& bIsBinary) const{...

2020-05-05 09:39:35 200

原创 C++ 获取文件内容

/* @ Input Param: -- strFilePath - 文件路径 -- bIsBinary -是否为二进制文件读取方式*/string getAllFile(const string& strFilePath, const bool& bIsBinary){ string strRet = ""; ifstream inFile; if (...

2020-05-05 09:34:03 606

原创 windows C++ 递归创建文件夹

//eg: strPath = "D:\\file\\test\\1.txt" 递归检查并创建该路径中的文件夹void createFolderForPath(const string& strPath){ string strFolder; int iPos = strPath.find_last_of('\\'); if (iPos != -1) { strFold...

2020-05-05 09:29:45 1725 1

C语言经典算法

常见经典的C语言基础算法模仿和学习

2016-08-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除