摘要: a[]:01230.10.20.30.4cumsums[]:(cumsums[i]表示返回值小于i的概率)012340.00.10.30.61.0static double cumsums[];void GetCumsums(double a[],double cumsums[],int length) (length=5){ cumsums[0] = 0.0; for(int index = 1;index < length;index++) { cumsums[index] = cumsums[index - 1] + a[index - 1]; }}int Discrete(dou 阅读全文
posted @ 2013-12-13 21:04 姚来飞 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 解析用空格分隔单词的字符串:void Analysis(char string[]){ if(string == NULL) { return; } int index = 0; while(isspace(string[index])) { index++; } int startIndexOfWord = index; int endIndexOfWord; while(string[index] != '\0') { if(isspace(string[index])) { endIndexOfWord = index - 1; ParseWord(string,star 阅读全文
posted @ 2013-12-13 20:05 姚来飞 阅读(200) 评论(0) 推荐(0) 编辑