字符串的反转
void Reverse(char s[])
{
for(int i =0,j=strlen(s)-1;i<j; ++i,--j)
{
char c=s[i];
s[i]=s[j];
s[j]=c;
}
}
将两个有序数组合成一个新的有序数组
int * merge(int a[],int n, int b[], int m) {
int i,j,k;
int c[m+n];
i = j = k = 0;
while (i < n && j < m) {
if (a[i] < b[j]){
c[k++] = a[i++];
}else{
c[k++] = b[j++];
}
}
while (i < n) {
c[k++] = a[i++];
}
while (j < m) {
c[k++] = b[j++];
}
return c;
}