- 博客(6)
- 资源 (4)
- 收藏
- 关注
原创 寻找数组的连续子数组的最大和
#include #include using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int maxSum(int* m,int size){ int * maxArr=new int[size];
2013-10-27 14:14:44
654
原创 递归 寻找满足条件的多个数
#include #include using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */list dataList;void find_factor(int sum,int n){ //递归出口
2013-10-26 17:01:30
793
原创 寻找满足条件的两个数
#include #include #include #include using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */pair findSum(int * m,int sum,int siz
2013-10-26 16:41:00
701
原创 字符串匹配问题
题目描述: 假设两个字符串中所含有的字符和个数都相同我们就叫这两个字符串匹配,比如:abcda和adabc, 由于出现的字符个数都是相同,只是顺序不同,所以这两个字符串是匹配的。#include #include #include #include using namespace std;bool isMatch(const char* str1,const char * str
2013-10-25 10:38:51
1137
原创 字符串是否包含问题利用素数求解
字符串是否包含的意思是一个短字符#include #include using namespace std;int primeNum[]={ 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101};bool compare(string longString,string shortSt
2013-10-24 21:30:42
1004
原创 C++ 字符串循环右移
#include #include #include using namespace std;//Reverse a char ,then k timesstring RightShift(string s, int N ,int k){ k=k%N; for(int i=0;i<k;i++){ int t=s[N-1]; for(int j=N-1;j>=0;j--){
2013-10-24 19:00:55
3952
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人