![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++基础
xiaomengxian1998
这个作者很懒,什么都没留下…
展开
-
STL string
1.string str; str.length()和str.size()是一样的; 2. string::size_type sz; 和 int sz是等效的; 3.GetLength是MFC的成员函数原创 2017-07-31 16:27:02 · 136 阅读 · 0 评论 -
leetcode 6
看完题目就蒙圈了,所以就直接看了别人的答案 几个答案看下来,基本上有这么三种思路 1.最清晰易懂的一种 string convert(string s,int numRows){ if(s.size() return s; int len=s.size(),j,row=0,step=1; string *str=new string[numRows]; f原创 2017-08-19 15:21:10 · 594 阅读 · 0 评论 -
位运算及简单应用
老实说,我对+ = * / % && || ==一些比较简单的运算符比较熟悉。对位运算就陌生了,主要用的少。我觉得高手用的会比较多,因为位运算速度比较快。 1.& 如果两个相应的二进制位都为1,则该位的结果值为1;否则为0。 注:下面都用8位的 unsigned char 来做例子。 &简单举例: 11&3 = 3 00001011 &转载 2017-08-19 15:52:20 · 195 阅读 · 0 评论