- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 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
412
转载 用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
998
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
301
转载 不定长数组取值交叉遍历组合生成算法
输入:一个二维数组,如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
511
原创 PHP实现拼音切分
通过汉语拼音的规律实现汉语拼音的切分,采用php实现。输入:一串连续的拼音,如zhongguo输出:zhong guofunction 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
823
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
619
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人