摘要: 1 #include 2 using namespace std; 3 4 int maxCover(int* a, int n, int l) 5 { 6 int maxCover = 1; 7 int begin = 0; 8 int end = 1; 9 while(end l)12 {13 maxCover = (end - begin) > maxCover?(end - begin):maxCover;14 begin++;15 }16 else1... 阅读全文
posted @ 2013-10-05 12:10 GOD_YCA 阅读(2377) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 4 void substring(char* str) 5 { 6 int len = strlen(str); 7 len = 2*len + 1; 8 for(int i = len; i >= 1; i--) 9 {10 if(i%2 == 0)11 str[i-1] = str[i/2-1];12 else13 str[i-1] = '#';14 }15 str[len] =... 阅读全文
posted @ 2013-10-05 10:51 GOD_YCA 阅读(537) 评论(0) 推荐(0) 编辑