摘要: 转白话经典算法系列之五 归并排序的实现#include using namespace std;//将有二个有序数列a[first...mid]和a[mid...last]合并。 void mergearray(int a[], int first, int mid, int last, int ... 阅读全文
posted @ 2015-01-23 14:50 清风书斋 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 原文作者不明 1 #include 2 using namespace std; 3 4 int AdjustArray(int s[], int l, int r) //返回调整后基准数的位置 5 { 6 int i = l, j = r; 7 int x = s[... 阅读全文
posted @ 2015-01-23 14:40 清风书斋 阅读(128) 评论(0) 推荐(0) 编辑
摘要: C++常用库函数atoi,itoa,strcpy,strcmp的实现C语言字符串操作函数1. 字符串反转 - strRev2. 字符串复制 - strcpy3. 字符串转化为整数 - atoi4. 字符串求长 - strlen5. 字符串连接 - strcat6. 字符串比较 - strcmp7. ... 阅读全文
posted @ 2015-01-23 14:25 清风书斋 阅读(451) 评论(0) 推荐(0) 编辑
摘要: strcmp函数是C/C++中基本的函数,它对两个字符串进行比较,然后返回比较结果,函数形式如下:int strcmp(constchar*str1,constchar*str2);其中str1和str2可以是字符串常量或者字符串变量,返回值为整形。返回结果如下规定:①str1小于str2,返回负值... 阅读全文
posted @ 2015-01-23 14:04 清风书斋 阅读(10184) 评论(0) 推荐(1) 编辑