摘要: 转载: 1、字符串数字之间的转换(1)string --> char * string str("OK"); char * p = str.c_str();(2)char * -->string char *p = "OK"; string str(p);(3)char * -->CString c 阅读全文
posted @ 2018-03-01 18:07 mysunicey 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 转载:本文实例汇总了C++常用字符串分割方法,分享给大家供大家参考。具体分析如下: string str;getline(cin,str);getline函数是遇回车符结束输入,而一般的CIN是遇到空格之类的就结束输入 string 类可以。需要注意的是输入字符串到这个(getline(cin,st 阅读全文
posted @ 2018-03-01 17:18 mysunicey 阅读(31985) 评论(0) 推荐(1) 编辑
摘要: Alice is taking a cryptography class and finding anagrams to be very useful. We consider two strings to be anagrams of each other if the first string' 阅读全文
posted @ 2018-02-28 14:27 mysunicey 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Sid is obsessed with reading short stories. Being a CS student, he is doing some interesting frequency analysis with the books. He chooses strings and 阅读全文
posted @ 2018-02-28 14:08 mysunicey 阅读(345) 评论(0) 推荐(0) 编辑
摘要: C++字符串长度获取函数以及其区别:(C/C++ strlen(str)和str.length()和str.size()都可以求字符串长度。其中str.length()和str.size()是用于求string类对象的成员函数 strlen(str)是用于求字符数组的长度,其参数是char*。)Probelm: 给你一个仅由小写字母组成的字符串。你的任务是找出一个位置,删掉那个字母之后,字符串变... 阅读全文
posted @ 2018-02-28 09:51 mysunicey 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 后退法: 阅读全文
posted @ 2018-02-08 11:18 mysunicey 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 小东所在公司要发年终奖,而小东恰好获得了最高福利,他要在公司年会上参与一个抽奖游戏,游戏在一 个6*6的棋盘上进行,上面放着36个价值不等的礼物,每个小的棋盘上面放置着一个礼物,他需要从左上 角开始游戏,每次只能向下或者向右移动一步,到达右下角停止,一路上的格子里的礼物小东都能拿到, 请设计一个算法 阅读全文
posted @ 2018-02-08 10:34 mysunicey 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 采用容器set C++ 采用容器map C++ 采用多维字符数组,比较字符串 C++ python 阅读全文
posted @ 2018-02-08 10:05 mysunicey 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 此考察的是动态规划问题,C++代码如下 如下测试输出: python代码 阅读全文
posted @ 2018-02-07 16:20 mysunicey 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 转载 Makefile 常用函数表一、字符串处理函数1.$(subst FROM,TO,TEXT)函数名称:字符串替换函数—subst。函数功能:把字串“TEXT”中的“FROM”字符替换为“TO”。返回值:替换后的新字符串。2.$(patsubst PATTERN,REPLACEMENT,TEXT 阅读全文
posted @ 2018-01-23 09:51 mysunicey 阅读(378) 评论(0) 推荐(0) 编辑