摘要: #include<iostream>#include<stdio.h>#include<string.h>using namespace std;int main(){ char s[50]={'\0'}; char str[30]="1233422222"; int len = strlen(str); for( int i = 0; i < len; ++i ) { int count = 1; while( str[i] == str[ i + 1 ] ) { i++; count++; } spr... 阅读全文
posted @ 2013-04-08 13:55 NinaGood 阅读(254) 评论(0) 推荐(0)
摘要: #include<iostream>#include<stdio.h>#include<string.h>using namespace std;void reverse( char * str ,int i,int j){ char tmp; while( i < j ) { tmp = str[i]; str[i] = str[j]; str[j] = tmp; i++; j--; }}int main(){ char str[]="i come from tianjin."; int len = strlen(str); in 阅读全文
posted @ 2013-04-08 10:58 NinaGood 阅读(156) 评论(0) 推荐(0)
摘要: //注意:检测函数值返回值是否NULL,当返回值为NULL时不能输出。#include<iostream>using namespace std;char * mystrstr( char * str, char * sub){ for( int i = 0; str[i] != '\0'; ++i ) { int j = 0; int tmp = i; if( str[i] == sub[j] ) { while( str[i++] == sub[j++] ) { if( sub[j] == '\0' ) { re... 阅读全文
posted @ 2013-04-08 09:44 NinaGood 阅读(315) 评论(0) 推荐(0)
摘要: 更多关于最长子串:http://blog.csdn.net/szu030606/article/details/8088596#include<iostream>#include<string>#include<string.h>using namespace std;int mycmp( const void * a, const void * b ){ return strcmp( *( char ** )a, *( char ** )b );}int cmp( char * str1, char * str2 ){ int len = 0; while 阅读全文
posted @ 2013-03-31 10:18 NinaGood 阅读(524) 评论(0) 推荐(0)
摘要: ***今天在我BF的帮助下完成了小小的程序,也是我第一次写博客呢,谢谢他哦嘎嘎1.首先,计算出下载文件的长度。conn=urllib.urlopen(url)headers=conn.info()File_len=int(headers['Content-Length'])2.根据所得到的文件长度对于每个线程确定下载数据的长度和开始下载位置。req=urllib2.Request('http://guidetodatamining.com/guide/ch2/BX-Dump.zip')req.headers['Range']='bytes 阅读全文
posted @ 2013-03-27 21:44 NinaGood 阅读(521) 评论(0) 推荐(0)