算法
testing2007
C++开发工程师
展开
-
排序算法
<br />#include "stdafx.h"void BubbleSort(int *a, int N){ //冒泡排序实现的两种方式 /* 思想: 执行n-1趟排序,把每一趟排序的最小值放在a[i]处 for(int i=0; i<N-1; ++i) { for(int j=i+1; j<N; ++j) { if(a[i]>a[j]) { int nTemp = a[i]; a[i] = a[j]; a[j]=nTemp;原创 2011-03-17 13:58:00 · 335 阅读 · 0 评论 -
实现在一个字符串中删除中文字符及空格的实现代码
<br />如题:以下代码实现。<br />#include "stdafx.h"#include <string.h>#include <malloc.h>void TrimChineseAndBlank(char *pDest, char *pSrc){ int nLen = strlen(pSrc)+1; while(*pSrc != '/0') { if( ((*pSrc>=-95)&&(*pSrc<=-1)) || (*pSrc==' ')) {原创 2011-03-21 16:59:00 · 737 阅读 · 0 评论 -
base64code 的一个例子代码
#include "stdafx.h"#include #include #include #include struct CartoonInfo{ std::wstring strInfo;};typedef std::vector VEC_CI;VEC_CI g_vci;void AddInfo(LPCWSTR info){ Ca原创 2012-04-05 18:33:25 · 1531 阅读 · 0 评论