字符串处理大合集
摘要:1 //任意输入字符串,可以包括任何字符。 2 //1、统计字符串中各个字符的个数,包括空格 3 //2、去除单词中间多余的空格,包括字符串首尾空格 4 //3、在数字和字母中间插入字符 5 //4、将单词提取出来,并统计单词的字母个数 6 //5、将字母排序,字母大小写的,保持原来先后顺序 7 //6、将指定的字符串替换为另一个字符串 8 #include 9 #includ...
阅读全文
posted @
2019-03-11 15:27
Aldrich_2020
阅读(328)
推荐(0)
字符串处理:去除首部空格,去除中间多余空格,在数字和字母中间插入指定字符串
摘要:1 #include 2 #include 3 bool isN(char c){//判断该字符是否是数字 4 if(c>='0'&&c='a'&&c='A'&&c<='Z')) 9 return true; 10 else return false; 11 } 12 int main(){ 13 char c[110]; 14 while(g...
阅读全文
posted @
2019-02-20 22:28
Aldrich_2020
阅读(538)
推荐(0)
0002:动态规划
摘要:动态规划的数塔问题 最大连续子序列和 最长不下降子序列(LIS)
阅读全文
posted @
2019-02-12 15:55
Aldrich_2020
阅读(210)
推荐(0)
0001:树的重建,各种递归遍历以及层序遍历
摘要:1 #include 2 #include 3 using namespace std; 4 struct node{ 5 int data; 6 node *lchild; 7 node *rchild; 8 }; 9 int pre[32],in[32]; 10 node *create(int preL,int preR,int...
阅读全文
posted @
2019-02-12 14:45
Aldrich_2020
阅读(169)
推荐(0)