开发
鱼在沙漠
扎实的基础很重要
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++实现拼音字符串切分的函数
函数功能: void split_func(string pinyin, string &split_str) { int i = 0; stringstream result; for (i = 0; i<(int)pinyin.size(); i++) { if (strchr("aeiouv", pinyin.at(i))) { result <...原创 2021-06-30 18:22:51 · 455 阅读 · 0 评论 -
用select+recv检测tcp长连接是否断开
int lSockFd = searchHelper->GetFd(); fd_set read_set; struct timeval t_o; FD_ZERO(&read_set); FD_SET(lSockFd, &read_set); t_o.tv_sec = 1;/* 超时秒数*/ int ret = select(lSockFd + 1, &read_set, NULL, NULL, &t_o); char buf[100] = {0}; if(ret =.转载 2020-11-10 10:29:21 · 1047 阅读 · 1 评论 -
二维vector取值交叉遍历组合生成算法
通过递归求出二维vector每一维vector中取一个数的各种组合 输入:[[a], [b1, b2], [c1, c2, c3]] 输出:[a_b1_c1, a_b1_c2, a_b1_c3, a_b2_c1, a_b2_c2, a_b2_c3] vector<string> combination(vector<vector<string> > &dimensionalArr){ int FLength = dimensionalArr.s.原创 2020-09-15 15:30:39 · 340 阅读 · 0 评论 -
不定长数组取值交叉遍历组合生成算法
输入:一个二维数组,如 int factor[3][4] = { {0, 1, 2, 3}, {0, 1}, {0, 1, 2}, }; 输出: 0 0 0 1 0 0 2 0 0 3 0 0 0 1 0 1 1 0 2 1 0 3 1 0 0 0 1 1 0 1 2 0 1 3 0 1 0 1 1 1 1 1 2 1 ...转载 2019-10-24 14:55:15 · 544 阅读 · 0 评论 -
PHP实现拼音切分
通过汉语拼音的规律实现汉语拼音的切分,采用php实现。 输入:一串连续的拼音,如zhongguo 输出:zhong guo function split_func($str){ $vowel = array('a','e','i','o','u','v');; $result = ""; $i = 0; for($i = 0; $i < strle...原创 2018-09-05 17:58:21 · 868 阅读 · 1 评论 -
拼音翻译为阿拉伯数字
该程序实现将拼音转换成阿拉伯数字的功能。 如输入:WuShiWu 则输出:55 #include<cctype> #include<iostream> #include<string> #include<map> using namespace std; int main() { string name[]={"Shi","Bai",...原创 2014-08-08 11:12:51 · 664 阅读 · 0 评论
分享