码迷,mamicode.com
首页 >  
搜索关键字:size_type    ( 266个结果
BNU 49100超级线段树
超级线段树 Time Limit: 5000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name: Main Prev Submit Status Statistics Discuss Next Font Size:  +   - Type:   ...
分类:其他好文   时间:2015-05-09 20:27:54    阅读次数:171
编程之美第三章-字符串移位包含的问题
#include #include using namespace std; bool find_str(string s1,string s2) { if(s1.empty()||s2.empty()) return false; string::size_type pos=s1.find(s2); return (pos!=string::npos)?true:false; } in...
分类:其他好文   时间:2015-05-08 14:54:42    阅读次数:155
C++ Primer第四版习题--3.13
//读一组数到vector对象,计算收尾配对元素的和并输出 #include #include int main() { std::vector ivec; int temp, add; while(std::cin>>temp) ivec.push_back(temp); typedef std::vector::size_type vec...
分类:编程语言   时间:2015-05-06 13:24:26    阅读次数:220
c++ 字符串工具类
#include #include using namespace std;namespace strtool{string trim(const string& str){ string::size_type pos = str.find_first_not_of(' '); if (...
分类:编程语言   时间:2015-04-29 19:18:09    阅读次数:191
编程之美中判断某个字符串是否是另一个字符串的移位结构的子串
#include #include using namespace std; bool is_circle(string src,string des) { if(src.empty()||des.empty()) return false; string temp=src; temp+=src; string::size_type pos=0; pos=temp.find(des)...
分类:其他好文   时间:2015-04-23 15:50:07    阅读次数:131
最大堆/最小堆/优先队列 实现代码(c++)
自我感觉代码写的比较乱,这方面要好好注意一下。总结:1.在使用vector::size_type 类似的类型时,千万要注意循环的条件判断,很容易发生溢出的危险!所以我最后很懒的选择使用int - -。2.下标表示和元素个数表示之间的细微差别。下标之间的变换关系:父节点 parent(i)=(i-1)...
分类:编程语言   时间:2015-04-05 17:16:34    阅读次数:151
剑指offer统计字符数组中第一次出现的字符
给定一个字符串,例如“abaccdeff”则第一次出现的字符就是b; #include #include using namespace std; void first(const string &input) { if(input.empty()) return ; string::size_type length=input.size(); int *times=new int[l...
分类:编程语言   时间:2015-04-03 13:34:49    阅读次数:136
vector API详细学习
vector是一种顺序容器。 构造函数: vector(); vector( const vector& c ); vector( size_type num, const TYPE& val = TYPE() ); vector( input_iterator start, inpu...
分类:Windows程序   时间:2015-04-01 01:42:02    阅读次数:324
string___assign
#include #include #include int main(){ std::string s; // assign(size_type count, CharT ch) s.assign(4, '='); std::cout ilist) s.assign({ 'C', '...
分类:其他好文   时间:2015-03-30 20:39:54    阅读次数:144
高效实现 std::string split() API
Qt下 QString 实现了split()函数,而std::string则没有实现,STL中也没有实现,只能自己写一个了。 #include #include using namespace std; vector split(string strtem,char a) { vector strvec; string::size_type po...
分类:Windows程序   时间:2015-03-20 14:25:57    阅读次数:189
266条   上一页 1 ... 14 15 16 17 18 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!