原题 找出一个字符串中最长重复次数的子字符串,并计算其重复次数。例如:字符串“abc fghi bc kl abcd lkm abcdefg”,并返回“abcd”和2。 我的思路 为了方便表述,我们使用变量src作为原字符串,sub_str作为子字符串。 由于题目要求寻找至少重复2次的最长的子字符串...
分类:
其他好文 时间:
2014-08-17 21:08:22
阅读次数:
475
string str("hello world");string *pstr = &str;cout << pstr[0] << endl;cout << *pstr << endl;本来以为psr[0]输出来的值是'h' 没有想到输出来的而是 hello world ,而且 *pstr输出的也是同...
分类:
其他好文 时间:
2014-08-17 15:32:32
阅读次数:
336
接触JS一段时间了,但总感觉不得要领,技术得不到提升,翻来覆去,决定对基础知识做一次系统的整理,要坚持每一天都有新的收获变量,即通过一个名字将一个值关联起来,以后通过变量就可以引用到该值,比如:var str = "Hello, World";当我们下一次要引用”Hello, Wrold”这个串.....
分类:
其他好文 时间:
2014-08-17 15:27:42
阅读次数:
120
摘要: 摘要: 原创出处: http://www.cnblogs.com/Alandre/ 泥沙砖瓦浆木匠 希望转载,保留摘要,谢谢!每天起床告诉自己,自己的目标是 ”技术 + 英语 还有生活“! -泥沙砖瓦浆木匠一.char说起到String二.String的认识及源码浅析一.char说起到Str...
分类:
编程语言 时间:
2014-08-17 13:02:22
阅读次数:
181
列表推导与生成器表达式当我们创建了一个列表的时候,就创建了一个可以迭代的对象:>>> squares=[n*n for n in range(3)]>>> for i in squares: print i 014这种创建列表的操作很常见,称为列表推导。但是像列表这样的迭代器,比如str、file等...
分类:
编程语言 时间:
2014-08-17 01:05:01
阅读次数:
330
#include #include #include #include using namespace std;void StringSplit(const string& str,vector& vStr,const char& division){ int startPos = 0; int e...
分类:
其他好文 时间:
2014-08-17 00:57:21
阅读次数:
345
定义:functionGetChineseCount(str){varchinieseCount=0;varbadChar="ABCDEFGHIJKLMNOPQRSTUVWXYZ";badChar+="abcdefghijklmnopqrstuvwxyz";badChar+="0123456789"...
分类:
编程语言 时间:
2014-08-16 23:39:11
阅读次数:
217
#include void function(char *str) { char buffer[16]; strcpy(buffer,str);
} int main() { char large_string[256]; int i; for( i = 0; i void function(cha...
分类:
其他好文 时间:
2014-08-16 22:28:11
阅读次数:
170
3.1略3.2string str;//读行 while(getline(cin,str)) cout>str) cout>a>>b; if(a==b) coutb) cout>a>>b; if(a.size()==b.siz...
分类:
编程语言 时间:
2014-08-16 22:20:21
阅读次数:
375
第一步:导入头文件 #import?<CoreLocation/CoreLocation.h>
#import?<CoreLocation/CLLocationManagerDelegate.h> 第二步:设置代理 CLLocationManagerDelegate 第三步:创建一个属性 @property(nonatomic,?str...
分类:
移动开发 时间:
2014-08-16 21:13:21
阅读次数:
233